diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-08-23 19:23:42 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-08-23 19:23:42 +0200 |
commit | a93c6db68bbb5070398b6cdb029a9bf0365846fc (patch) | |
tree | 9e807583a6cc0ee68e10985974a111ae548ce343 /Lib/test/test_os.py | |
parent | 330cc52c99037eaabe0fcfa09f9b099743b0b913 (diff) | |
parent | 0c2dd0c0a9498422645a2805a955b9a898298bc6 (diff) | |
download | cpython-git-a93c6db68bbb5070398b6cdb029a9bf0365846fc.tar.gz |
(Merge 3.3) 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/test_os.py')
-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 b7796b5607..a4be0bb1a6 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -646,10 +646,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().""" |