Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Commit

Permalink
Don't abuse __builtins__
Browse files Browse the repository at this point in the history
According to Jean-Paul Calderone at https://bugs.launchpad.net/pycrypto/+bug/785150:

    `__builtins__` is an implementation detail of CPython. It takes on
    inconsistent values at various times. The use in `common.py` happens to
    work on recent version of CPython, but it doesn't work on PyPy. The only
    thing you should ever do, when you're doing this sort of thing, is "import
    __builtin__; __builtin__.foo".
  • Loading branch information
dlitz committed Oct 11, 2011
1 parent 7401e64 commit 25a0553
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions ACKS
Expand Up @@ -21,6 +21,7 @@ Ian Bicking
Joris Bontje
Antoon Bosselaers
Andrea Bottoni
Jean-Paul Calderone
Sergey Chernov
Geremy Condra
Jan Dittberner
Expand Down
2 changes: 1 addition & 1 deletion lib/Crypto/SelfTest/Cipher/common.py
Expand Up @@ -38,7 +38,7 @@
def dict(**kwargs):
return kwargs.copy()
else:
dict = __builtins__['dict']
dict = dict

class _NoDefault: pass # sentinel object
def _extract(d, k, default=_NoDefault):
Expand Down
2 changes: 1 addition & 1 deletion lib/Crypto/SelfTest/Hash/common.py
Expand Up @@ -38,7 +38,7 @@
def dict(**kwargs):
return kwargs.copy()
else:
dict = __builtins__['dict']
dict = dict


class HashSelfTest(unittest.TestCase):
Expand Down

0 comments on commit 25a0553

Please sign in to comment.