diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-08-23 17:19:15 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-08-23 17:19:15 (GMT) |
commit | 0c2dd0c0a9498422645a2805a955b9a898298bc6 (patch) | |
tree | f98ad2598c161f12732d501b7ee18540a3efa727 /Lib/test | |
parent | f1e0273023d870e575add13dc05ab507ed05268f (diff) | |
download | cpython-0c2dd0c0a9498422645a2805a955b9a898298bc6.zip cpython-0c2dd0c0a9498422645a2805a955b9a898298bc6.tar.gz cpython-0c2dd0c0a9498422645a2805a955b9a898298bc6.tar.bz2 |
Close #17702: On error, os.environb now removes suppress the except context
when raising a new KeyError with the original key.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_os.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 2db030e..fbf6c0c 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -644,10 +644,13 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol): with self.assertRaises(KeyError) as cm: os.environ[missing] self.assertIs(cm.exception.args[0], missing) + self.assertTrue(cm.exception.__suppress_context__) with self.assertRaises(KeyError) as cm: del os.environ[missing] self.assertIs(cm.exception.args[0], missing) + self.assertTrue(cm.exception.__suppress_context__) + class WalkTests(unittest.TestCase): """Tests for os.walk().""" |