[Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.29, 1.29.2.1

bcannon@users.sourceforge.net bcannon at users.sourceforge.net
Thu Sep 15 04:42:08 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6239/Lib/test

Modified Files:
      Tag: release24-maint
	test_strptime.py 
Log Message:
Clear the regex cache when the locale changes.

Backport of fix for bug #1290505.


Index: test_strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v
retrieving revision 1.29
retrieving revision 1.29.2.1
diff -u -d -r1.29 -r1.29.2.1
--- test_strptime.py	28 Oct 2004 04:49:21 -0000	1.29
+++ test_strptime.py	15 Sep 2005 02:42:05 -0000	1.29.2.1
@@ -462,10 +462,12 @@
         # Make sure cache is recreated when current locale does not match what
         # cached object was created with.
         _strptime.strptime("10", "%d")
+        _strptime.strptime("2005", "%Y")
         _strptime._TimeRE_cache.locale_time.lang = "Ni"
         original_time_re = id(_strptime._TimeRE_cache)
         _strptime.strptime("10", "%d")
         self.failIfEqual(original_time_re, id(_strptime._TimeRE_cache))
+        self.failUnlessEqual(len(_strptime._regex_cache), 1)
 
     def test_regex_cleanup(self):
         # Make sure cached regexes are discarded when cache becomes "full".



More information about the Python-checkins mailing list