Skip to content

Commit

Permalink
Respect PURE_PYTHON environment variable set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
perrinjerome committed Oct 2, 2024
1 parent 1b6affb commit afc6ee6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
7.3 (unreleased)
----------------

- Respect ``PURE_PYTHON`` environment variable set to ``0``.


7.2 (2024-09-17)
----------------
Expand Down
2 changes: 1 addition & 1 deletion src/zope/security/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

py_impl = getattr(platform, 'python_implementation', lambda: None)
PYPY = py_impl() == 'PyPy'
PURE_PYTHON = os.environ.get('PURE_PYTHON', PYPY)
PURE_PYTHON = int(os.environ.get('PURE_PYTHON', PYPY))


class implementer_if_needed:
Expand Down
8 changes: 4 additions & 4 deletions src/zope/security/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
(:func:`getCheckerForInstancesOf`, :func:`selectChecker`).
This module is accelerated with a C implementation on CPython by
default. If the environment variable ``PURE_PYTHON`` is set (to any
value) before this module is imported, the C extensions will be
bypassed and the reference Python implementations will be used. This
can be helpful for debugging and tracing.
default. If the environment variable ``PURE_PYTHON`` is set to ``1``
before this module is imported, the C extensions will be bypassed and
the reference Python implementations will be used. This can be helpful for
debugging and tracing.
Debugging Permissions Problems
==============================
Expand Down

0 comments on commit afc6ee6

Please sign in to comment.