Skip to content

Commit

Permalink
fix: detection of PURE_PYTHON where environ sets '0'
Browse files Browse the repository at this point in the history
E.g., our current 'tox.ini' does this, which effectively disables testing
the C extension.
  • Loading branch information
tseaver committed May 26, 2024
1 parent 62728cd commit 72dc5fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/zope/hookable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


_PYPY = platform.python_implementation() in ('PyPy', 'Jython')
_PURE_PYTHON = os.environ.get('PURE_PYTHON', _PYPY)
_PURE_PYTHON = os.environ.get('PURE_PYTHON') == '1'


class _py_hookable:
Expand Down Expand Up @@ -69,7 +69,7 @@ def __call__(self, *args, **kw):
except ImportError: # pragma: no cover
_c_hookable = None

if _PURE_PYTHON or _c_hookable is None:
if _PYPY or _PURE_PYTHON or _c_hookable is None:
hookable = _py_hookable
else: # pragma: no cover
hookable = _c_hookable

0 comments on commit 72dc5fb

Please sign in to comment.