aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/env.py
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-09-14 09:28:47 +0200
committergatecat <gatecat@ds0.me>2022-09-14 09:28:47 +0200
commita72f898ff4c4237424c468044a6db9d6953b541e (patch)
tree1c4a543f661dd1b281aecf4660388491702fa8d8 /3rdparty/pybind11/tests/env.py
parentf1349e114f3a16ccd002e8513339e18f5be4d31b (diff)
downloadnextpnr-a72f898ff4c4237424c468044a6db9d6953b541e.tar.gz
nextpnr-a72f898ff4c4237424c468044a6db9d6953b541e.tar.bz2
nextpnr-a72f898ff4c4237424c468044a6db9d6953b541e.zip
3rdparty: Bump vendored pybind11 version for py3.11 support
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to '3rdparty/pybind11/tests/env.py')
-rw-r--r--3rdparty/pybind11/tests/env.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/3rdparty/pybind11/tests/env.py b/3rdparty/pybind11/tests/env.py
index 5cded441..0345df65 100644
--- a/3rdparty/pybind11/tests/env.py
+++ b/3rdparty/pybind11/tests/env.py
@@ -1,7 +1,8 @@
-# -*- coding: utf-8 -*-
import platform
import sys
+import pytest
+
LINUX = sys.platform.startswith("linux")
MACOS = sys.platform.startswith("darwin")
WIN = sys.platform.startswith("win32") or sys.platform.startswith("cygwin")
@@ -9,6 +10,19 @@ WIN = sys.platform.startswith("win32") or sys.platform.startswith("cygwin")
CPYTHON = platform.python_implementation() == "CPython"
PYPY = platform.python_implementation() == "PyPy"
-PY2 = sys.version_info.major == 2
-PY = sys.version_info
+def deprecated_call():
+ """
+ pytest.deprecated_call() seems broken in pytest<3.9.x; concretely, it
+ doesn't work on CPython 3.8.0 with pytest==3.3.2 on Ubuntu 18.04 (#2922).
+
+ This is a narrowed reimplementation of the following PR :(
+ https://github.com/pytest-dev/pytest/pull/4104
+ """
+ # TODO: Remove this when testing requires pytest>=3.9.
+ pieces = pytest.__version__.split(".")
+ pytest_major_minor = (int(pieces[0]), int(pieces[1]))
+ if pytest_major_minor < (3, 9):
+ return pytest.warns((DeprecationWarning, PendingDeprecationWarning))
+ else:
+ return pytest.deprecated_call()