mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
#6707 fix a crash with dir() on an uninitialized module
This commit is contained in:
parent
75e1f9985a
commit
4c6e8088f5
3 changed files with 8 additions and 3 deletions
|
|
@ -11,6 +11,7 @@ class ModuleTests(unittest.TestCase):
|
|||
# and __doc__ is None
|
||||
foo = ModuleType.__new__(ModuleType)
|
||||
self.assertTrue(foo.__dict__ is None)
|
||||
self.assertRaises(SystemError, dir, foo)
|
||||
try:
|
||||
s = foo.__name__
|
||||
self.fail("__name__ = %s" % repr(s))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue