Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 1 addition & 7 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 10 additions & 0 deletions tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
Loading