mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Fix the tests by restoring __import__. I think the test is still valid.
This commit is contained in:
parent
f336c8b7e9
commit
bf839e2efa
1 changed files with 6 additions and 4 deletions
|
@ -4481,7 +4481,6 @@ def test_borrowed_ref_4_segfault():
|
|||
import types
|
||||
import __builtin__
|
||||
|
||||
|
||||
class X(object):
|
||||
def __getattr__(self, name):
|
||||
# this is called with name == '__bases__' by PyObject_IsInstance()
|
||||
|
@ -4498,9 +4497,12 @@ def test_borrowed_ref_4_segfault():
|
|||
return (self, args)
|
||||
|
||||
# make an unbound method
|
||||
__builtin__.__import__ = types.MethodType(Y(), None, (pseudoclass, str))
|
||||
import spam
|
||||
|
||||
orig_import = __import__
|
||||
try:
|
||||
__builtin__.__import__ = types.MethodType(Y(), None, (pseudoclass, str))
|
||||
import spam
|
||||
finally:
|
||||
__builtin__.__import__ = orig_import
|
||||
|
||||
def test_main():
|
||||
#XXXweakref_segfault() # Must be first, somehow
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue