summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_import.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-03-12 16:11:39 (GMT)
committerCollin Winter <collinw@gmail.com>2007-03-12 16:11:39 (GMT)
commit276887b16dc86e3423760c6ed9353591708fba17 (patch)
tree04e9896ffc00c0291959b4be71a83273e790b4ad /Lib/test/test_import.py
parentf567ca3e1ae851ea6e7418da3df47e034841a08d (diff)
downloadcpython-276887b16dc86e3423760c6ed9353591708fba17.zip
cpython-276887b16dc86e3423760c6ed9353591708fba17.tar.gz
cpython-276887b16dc86e3423760c6ed9353591708fba17.tar.bz2
Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Will backport.
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r--Lib/test/test_import.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index a6db281..cc932a2 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -192,6 +192,16 @@ class ImportTest(unittest.TestCase):
remove_files(TESTFN)
if TESTFN in sys.modules:
del sys.modules[TESTFN]
+
+ def test_infinite_reload(self):
+ # Bug #742342 reports that Python segfaults (infinite recursion in C)
+ # when faced with self-recursive reload()ing.
+
+ sys.path.insert(0, os.path.dirname(__file__))
+ try:
+ import infinite_reload
+ finally:
+ sys.path.pop(0)
def test_import_name_binding(self):
# import x.y.z binds x in the current namespace