Crypto/SelfTest/Cipher/common.py misuses __builtins__

Bug #785150 reported by Jean-Paul Calderone
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python-Crypto
Fix Released
Undecided
Unassigned

Bug Description

`__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".

However, line 40 of common.py (in release 2.3):

    dict = __builtins__['dict']

would be better written simply as:

    dict = dict

Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

The same thing is done in Crypto/SelfTest/Hash/common.py

Revision history for this message
Darsey Litzenberger (dlitz) wrote :
Changed in pycrypto:
status: New → Incomplete
status: Incomplete → Fix Committed
Revision history for this message
Darsey Litzenberger (dlitz) wrote :

Released in PyCrypto 2.4.

Changed in pycrypto:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.