mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
#18681: Fix a NameError in imp.reload() (noticed by Weizhao Li).
This commit is contained in:
parent
a9e67ad993
commit
056bafe7a6
3 changed files with 12 additions and 1 deletions
|
@ -275,6 +275,15 @@ class ReloadTests(unittest.TestCase):
|
|||
import marshal
|
||||
imp.reload(marshal)
|
||||
|
||||
def test_with_deleted_parent(self):
|
||||
# see #18681
|
||||
from html import parser
|
||||
del sys.modules['html']
|
||||
def cleanup(): del sys.modules['html.parser']
|
||||
self.addCleanup(cleanup)
|
||||
with self.assertRaisesRegex(ImportError, 'html'):
|
||||
imp.reload(parser)
|
||||
|
||||
|
||||
class PEP3147Tests(unittest.TestCase):
|
||||
"""Tests of PEP 3147."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue