From 87e984c1eda4e630e017f013718c0e6dc1a573dd Mon Sep 17 00:00:00 2001 From: R David Murray Date: Fri, 19 Apr 2013 22:38:58 -0400 Subject: #9607: restore keywords.kwlist after testing it. --- Lib/test/test_keyword.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_keyword.py b/Lib/test/test_keyword.py index ccadd94..45a12b9 100644 --- a/Lib/test/test_keyword.py +++ b/Lib/test/test_keyword.py @@ -29,6 +29,8 @@ class Test_iskeyword(unittest.TestCase): # This is probably an accident of the current implementation, but should be # preserved for backward compatibility. def test_changing_the_kwlist_does_not_affect_iskeyword(self): + oldlist = keyword.kwlist + self.addCleanup(lambda: setattr(keyword, 'kwlist', oldlist)) keyword.kwlist = ['its', 'all', 'eggs', 'beans', 'and', 'a', 'slice'] self.assertFalse(keyword.iskeyword('eggs')) -- cgit v0.12