summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorŽiga Seilnacht <ziga.seilnacht@gmail.com>2007-03-21 20:07:56 (GMT)
committerŽiga Seilnacht <ziga.seilnacht@gmail.com>2007-03-21 20:07:56 (GMT)
commit7492e4260e4f6231f6f30a0f10f514115b9233cb (patch)
tree826f8de8fc8403ea49a6fb682c18f4c940a959c4 /Lib/test/test_re.py
parent3ff9e558901b49551e27ee48a1fb39b65037e889 (diff)
downloadcpython-7492e4260e4f6231f6f30a0f10f514115b9233cb.zip
cpython-7492e4260e4f6231f6f30a0f10f514115b9233cb.tar.gz
cpython-7492e4260e4f6231f6f30a0f10f514115b9233cb.tar.bz2
Bug #1675967: re patterns pickled with older Python versions can
now be unpickled. Will backport.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 14a0acf..bb56861 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1,7 +1,7 @@
import sys
sys.path = ['.'] + sys.path
-from test.test_support import verbose, run_unittest
+from test.test_support import verbose, run_unittest, guard_warnings_filter
import re
from re import Scanner
import sys, os, traceback
@@ -414,6 +414,12 @@ class ReTests(unittest.TestCase):
self.pickle_test(pickle)
import cPickle
self.pickle_test(cPickle)
+ # old pickles expect the _compile() reconstructor in sre module
+ import warnings
+ with guard_warnings_filter():
+ warnings.filterwarnings("ignore", "The sre module is deprecated",
+ DeprecationWarning)
+ from sre import _compile
def pickle_test(self, pickle):
oldpat = re.compile('a(?:b|(c|e){1,2}?|d)+?(.)')