mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-31862: Port binascii to PEP 489 multiphase initialization (GH-4108)
This commit is contained in:
parent
77aa396bb9
commit
33e71e01e9
3 changed files with 118 additions and 34 deletions
|
@ -473,6 +473,19 @@ class SubinterpreterTest(unittest.TestCase):
|
|||
self.assertNotEqual(pickle.load(f), id(sys.modules))
|
||||
self.assertNotEqual(pickle.load(f), id(builtins))
|
||||
|
||||
def test_mutate_exception(self):
|
||||
"""
|
||||
Exceptions saved in global module state get shared between
|
||||
individual module instances. This test checks whether or not
|
||||
a change in one interpreter's module gets reflected into the
|
||||
other ones.
|
||||
"""
|
||||
import binascii
|
||||
|
||||
support.run_in_subinterp("import binascii; binascii.Error.foobar = 'foobar'")
|
||||
|
||||
self.assertFalse(hasattr(binascii.Error, "foobar"))
|
||||
|
||||
|
||||
class TestThreadState(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue