diff options
author | Zuul <zuul@review.opendev.org> | 2023-01-07 00:17:13 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-01-07 00:17:13 +0000 |
commit | 1ca77814931463993b15fbbb13a26e027a485cd3 (patch) | |
tree | 5104346f91b5d0d9a36368ca31d24bf9c1f20792 | |
parent | 535254d5c8b9c0159017febafc882b58c873abe2 (diff) | |
parent | 61c6a4bcb305cd14cd913fc88ade4b1c0d21eb8c (diff) | |
download | pbr-1ca77814931463993b15fbbb13a26e027a485cd3.tar.gz |
Merge "Tie recursion calls to Dist object, not module"
-rw-r--r-- | pbr/core.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/pbr/core.py b/pbr/core.py index a801737..fb592f8 100644 --- a/pbr/core.py +++ b/pbr/core.py @@ -61,11 +61,6 @@ else: integer_types = (int, long) # noqa -# We use this canary to detect whether the module has already been called, -# in order to avoid recursion -in_use = False - - def pbr(dist, attr, value): """Implements the actual pbr setup() keyword. @@ -91,10 +86,9 @@ def pbr(dist, attr, value): # particularly when using PEP517 build-system configs without # setup_requires in setup.py. We can avoid the recursion by setting # this canary so we don't repeat ourselves. - global in_use - if in_use: + if hasattr(dist, '_pbr_initialized'): return - in_use = True + dist._pbr_initialized = True if not value: return |