[Python-checkins] cpython (merge 3.2 -> default): #14179: merge with 3.2.

ezio.melotti python-checkins at python.org
Tue Mar 13 00:33:51 CET 2012


http://hg.python.org/cpython/rev/4a5eafcdde11
changeset:   75566:4a5eafcdde11
parent:      75564:3c875719e46d
parent:      75565:fafe12f2a030
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Tue Mar 13 01:33:30 2012 +0200
summary:
  #14179: merge with 3.2.

files:
  Lib/test/test_re.py |  10 ++++++++++
  Misc/ACKS           |   1 +
  2 files changed, 11 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -825,6 +825,16 @@
         self.assertIsNotNone(re.search("123.*-", '123\U0010ffff-'))
         self.assertIsNotNone(re.search("123.*-", '123\xe9\u20ac\U0010ffff-'))
 
+    def test_compile(self):
+        # Test return value when given string and pattern as parameter
+        pattern = re.compile('random pattern')
+        self.assertIsInstance(pattern, re._pattern_type)
+        same_pattern = re.compile(pattern)
+        self.assertIsInstance(same_pattern, re._pattern_type)
+        self.assertIs(same_pattern, pattern)
+        # Test behaviour when not given a string or pattern as parameter
+        self.assertRaises(TypeError, re.compile, 0)
+
 def run_re_tests():
     from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
     if verbose:
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -687,6 +687,7 @@
 Dom Mitchell
 Dustin J. Mitchell
 Zubin Mithra
+Florian Mladitsch
 Doug Moen
 The Dragon De Monsyne
 Skip Montanaro

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


More information about the Python-checkins mailing list