[Python-checkins] cpython: #9607: restore keywords.kwlist after testing it.

r.david.murray python-checkins at python.org
Sat Apr 20 04:40:26 CEST 2013


http://hg.python.org/cpython/rev/d499189e7758
changeset:   83458:d499189e7758
user:        R David Murray <rdmurray at bitdance.com>
date:        Fri Apr 19 22:38:58 2013 -0400
summary:
  #9607: restore keywords.kwlist after testing it.

files:
  Lib/test/test_keyword.py |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_keyword.py b/Lib/test/test_keyword.py
--- a/Lib/test/test_keyword.py
+++ b/Lib/test/test_keyword.py
@@ -29,6 +29,8 @@
     # 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'))
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list