diff options
author | Marcel Plch <mplch@redhat.com> | 2019-05-22 11:51:26 (GMT) |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2019-05-22 11:51:25 (GMT) |
commit | 33e71e01e95506cf8d93fd68251fc56352bc7b39 (patch) | |
tree | 1b0727e1cc7f785d7e060f7a1efe42a402221787 /Lib | |
parent | 77aa396bb9415428de09112ddf6b34bb843811eb (diff) | |
download | cpython-33e71e01e95506cf8d93fd68251fc56352bc7b39.zip cpython-33e71e01e95506cf8d93fd68251fc56352bc7b39.tar.gz cpython-33e71e01e95506cf8d93fd68251fc56352bc7b39.tar.bz2 |
bpo-31862: Port binascii to PEP 489 multiphase initialization (GH-4108)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_capi.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index 8bcbd82..a062a65 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -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): |