Skip to content

Commit b6639d6

Browse files
committed
Avoid multiple patching of distribution
1 parent 1ca8bbf commit b6639d6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hpy/devel/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ def handle_hpy_ext_modules(dist, attr, hpy_ext_modules):
177177
"""
178178
assert attr == 'hpy_ext_modules'
179179

180+
# It can happen that this hook will be called multiple times depending on
181+
# which command was used. So, skip patching if we already patched the
182+
# distribution.
183+
if getattr(dist, 'hpydevel', None):
184+
return
185+
180186
# add a global option --hpy-abi to setup.py
181187
dist.__class__.hpy_abi = DEFAULT_HPY_ABI
182188
dist.__class__.hpy_use_static_libs = False

0 commit comments

Comments
 (0)