Skip to content

Commit

Permalink
Avoid multiple patching of distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
fangerer committed Apr 28, 2023
1 parent 1ca8bbf commit b6639d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hpy/devel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ def handle_hpy_ext_modules(dist, attr, hpy_ext_modules):
"""
assert attr == 'hpy_ext_modules'

# It can happen that this hook will be called multiple times depending on
# which command was used. So, skip patching if we already patched the
# distribution.
if getattr(dist, 'hpydevel', None):
return

# add a global option --hpy-abi to setup.py
dist.__class__.hpy_abi = DEFAULT_HPY_ABI
dist.__class__.hpy_use_static_libs = False
Expand Down

0 comments on commit b6639d6

Please sign in to comment.