diff --git a/src/__init__.py b/src/__init__.py index 5efb0f368..97890ed45 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -464,12 +464,7 @@ def _format_g(value, *, fmt='%g'): format_g = _format_g -# ByteString is gone from typing in 3.14. -# collections.abc.Buffer available from 3.12 only -try: - ByteString = typing.ByteString -except AttributeError: - ByteString = bytes | bytearray | memoryview +ByteString = bytes | bytearray | memoryview # Names required by class method typing annotations. OptBytes = typing.Optional[ByteString] diff --git a/src/utils.py b/src/utils.py index 7d3271ea8..6afdb45e0 100644 --- a/src/utils.py +++ b/src/utils.py @@ -24,13 +24,7 @@ matrix_like = "matrix_like" quad_like = "quad_like" -# ByteString is gone from typing in 3.14. -# collections.abc.Buffer available from 3.12 only -try: - ByteString = typing.ByteString -except AttributeError: - # pylint: disable=unsupported-binary-operation - ByteString = bytes | bytearray | memoryview +ByteString = bytes | bytearray | memoryview AnyType = typing.Any OptInt = typing.Union[int, None] diff --git a/tests/test_general.py b/tests/test_general.py index 11af8f598..9dc2f25d6 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -2023,6 +2023,16 @@ def test_4392(): print(f'{pymupdf.swig_version=}', flush=1) print(f'{pymupdf.swig_version_tuple=}', flush=1) + # pytest exit codes + # (https://docs.pytest.org/en/latest/reference/exit-codes.html): + # + # Exit code 0: All tests were collected and passed successfully + # Exit code 1: Tests were collected and run but some of the tests failed + # Exit code 2: Test execution was interrupted by the user + # Exit code 3: Internal error happened while executing tests + # Exit code 4: pytest command line usage error + # Exit code 5: No tests were collected + assert e1 == 5 if pymupdf.swig_version_tuple >= (4, 4): if sysconfig.get_config_var('Py_GIL_DISABLED') == 1 and sys._is_gil_enabled():