These functions were only defined in the the stgit.utils module when they were not present in __builtins__, however transaction.py unconditionally imported these symbols. This was breaking PyPy since builtins are not assumed to be in the stgit.transaction module namespace. Apparently in CPython, builtins are implicitly in modules' namespaces.
Signed-off-by: Peter Grayson <[email protected]> --- stgit/lib/transaction.py | 2 +- stgit/utils.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/stgit/lib/transaction.py b/stgit/lib/transaction.py index 4d7214e9..4532acba 100644 --- a/stgit/lib/transaction.py +++ b/stgit/lib/transaction.py @@ -5,7 +5,7 @@ import atexit import itertools as it from stgit import exception, utils -from stgit.utils import any, all +from stgit.utils import any from stgit.out import * from stgit.lib import git, log from stgit.config import config diff --git a/stgit/utils.py b/stgit/utils.py index 83679d47..3159b12f 100644 --- a/stgit/utils.py +++ b/stgit/utils.py @@ -293,13 +293,18 @@ def make_patch_name(msg, unacceptable, default_name = 'patch'): # any and all functions are builtin in Python 2.5 and higher, but not # in 2.4. -if not 'any' in dir(__builtins__): +if 'any' in dir(__builtins__): + any = getattr(__builtins__, 'any') +else: def any(bools): for b in bools: if b: return True return False -if not 'all' in dir(__builtins__): + +if 'all' in dir(__builtins__): + all = getattr(__builtins__, 'all') +else: def all(bools): for b in bools: if not b: _______________________________________________ stgit-users mailing list [email protected] https://mail.gna.org/listinfo/stgit-users
