Kaydet (Commit) 87e984c1 authored tarafından R David Murray's avatar R David Murray

#9607: restore keywords.kwlist after testing it.

üst 32a23c36
...@@ -29,6 +29,8 @@ class Test_iskeyword(unittest.TestCase): ...@@ -29,6 +29,8 @@ class Test_iskeyword(unittest.TestCase):
# This is probably an accident of the current implementation, but should be # This is probably an accident of the current implementation, but should be
# preserved for backward compatibility. # preserved for backward compatibility.
def test_changing_the_kwlist_does_not_affect_iskeyword(self): 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'] keyword.kwlist = ['its', 'all', 'eggs', 'beans', 'and', 'a', 'slice']
self.assertFalse(keyword.iskeyword('eggs')) self.assertFalse(keyword.iskeyword('eggs'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment