summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-04-20 02:38:58 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-04-20 02:38:58 (GMT)
commit87e984c1eda4e630e017f013718c0e6dc1a573dd (patch)
tree9fad5061dfbd5fdea6d88efa929227b6efdf9f4a /Lib
parent32a23c36b44b080973d774064da7718f31bca193 (diff)
downloadcpython-87e984c1eda4e630e017f013718c0e6dc1a573dd.zip
cpython-87e984c1eda4e630e017f013718c0e6dc1a573dd.tar.gz
cpython-87e984c1eda4e630e017f013718c0e6dc1a573dd.tar.bz2
#9607: restore keywords.kwlist after testing it.
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'))