fix location of magic AssertionError

--HG--
branch : trunk
This commit is contained in:
Benjamin Peterson 2009-08-28 18:07:28 -05:00
parent 783e6aeb4d
commit c23cc3656c
2 changed files with 3 additions and 3 deletions

View File

@ -133,7 +133,7 @@ initpkg(__name__,
'code.getrawcode' : ('./code/code.py', 'getrawcode'),
'code.patch_builtins' : ('./code/code.py', 'patch_builtins'),
'code.unpatch_builtins' : ('./code/code.py', 'unpatch_builtins'),
'code._AssertionError' : ('./code/assertion.py', 'AssertionError'),
'code._AssertionError' : ('./code/_assertion.py', 'AssertionError'),
# backports and additions of builtins
'builtin.__doc__' : ('./builtin/__init__.py', '__doc__'),

View File

@ -739,10 +739,10 @@ oldbuiltins = {}
def patch_builtins(assertion=True, compile=True):
""" put compile and AssertionError builtins to Python's builtins. """
if assertion:
from py.__.code import assertion
from py.__.code import _assertion
l = oldbuiltins.setdefault('AssertionError', [])
l.append(py.builtin.builtins.AssertionError)
py.builtin.builtins.AssertionError = assertion.AssertionError
py.builtin.builtins.AssertionError = _assertion.AssertionError
if compile:
l = oldbuiltins.setdefault('compile', [])
l.append(py.builtin.builtins.compile)