Author: Philip Jenvey <pjen...@underboss.org>
Branch: py3k
Changeset: r73724:5f38597ef8a9
Date: 2014-09-26 20:04 -0700
http://bitbucket.org/pypy/pypy/changeset/5f38597ef8a9/

Log:    fix missing endDFAs for u prefix'd tripled quoted strings

diff --git a/pypy/interpreter/pyparser/pytokenize.py 
b/pypy/interpreter/pyparser/pytokenize.py
--- a/pypy/interpreter/pyparser/pytokenize.py
+++ b/pypy/interpreter/pyparser/pytokenize.py
@@ -35,8 +35,9 @@
         prefix = uniPrefix + rawPrefix
         endDFAs[prefix + "'''"] = single3DFA
         endDFAs[prefix + '"""'] = double3DFA
-endDFAs["u'''"] = single3DFA
-endDFAs['U"""'] = double3DFA
+for uniPrefix in ("u", "U"):
+    endDFAs[uniPrefix + "'''"] = single3DFA
+    endDFAs[uniPrefix + '"""'] = double3DFA
 
 whiteSpaceStatesAccepts = [True]
 whiteSpaceStates = [{'\t': 0, ' ': 0, '\x0c': 0}]
diff --git a/pypy/interpreter/pyparser/test/test_pyparse.py 
b/pypy/interpreter/pyparser/test/test_pyparse.py
--- a/pypy/interpreter/pyparser/test/test_pyparse.py
+++ b/pypy/interpreter/pyparser/test/test_pyparse.py
@@ -146,6 +146,12 @@
         self.parse('a, *rest, b = 1, 2, 3, 4, 5')
         self.parse('(a, *rest, b) = 1, 2, 3, 4, 5')
 
+    def test_u_triple_quote(self):
+        self.parse('u""""""')
+        self.parse('U""""""')
+        self.parse("u''''''")
+        self.parse("U''''''")
+
 
 class TestPythonParserWithSpace:
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to