summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_keyword.py2
1 files changed, 2 insertions, 0 deletions
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'))