[pypy-svn] r17760 - in pypy/dist/pypy/interpreter/pyparser: . test

ac at codespeak.net ac at codespeak.net
Thu Sep 22 10:48:19 CEST 2005


Author: ac
Date: Thu Sep 22 10:48:19 2005
New Revision: 17760

Modified:
   pypy/dist/pypy/interpreter/pyparser/parsestring.py
   pypy/dist/pypy/interpreter/pyparser/test/test_parsestring.py
Log:
Fix bad quote quoting.

Modified: pypy/dist/pypy/interpreter/pyparser/parsestring.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/parsestring.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/parsestring.py	Thu Sep 22 10:48:19 2005
@@ -140,7 +140,7 @@
         elif ch == "'":
             lis.append("'")
         elif ch == '"':
-            lis.append("'")
+            lis.append('"')
         elif ch == 'b':
             lis.append("\010")
         elif ch == 'f':

Modified: pypy/dist/pypy/interpreter/pyparser/test/test_parsestring.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/test/test_parsestring.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/test/test_parsestring.py	Thu Sep 22 10:48:19 2005
@@ -32,6 +32,15 @@
         w_ret = parsestring.parsestr(space, None, s)
         assert space.str_w(w_ret) == chr(0xFF)
 
+        s = r'"\""'
+        w_ret = parsestring.parsestr(space, None, s)
+        assert space.str_w(w_ret) == '"'
+        
+        s = r"'\''"
+        w_ret = parsestring.parsestr(space, None, s)
+        assert space.str_w(w_ret) == "'"
+        
+        
     def test_unicode(self):
         space = self.space
         s = u'hello world'



More information about the Pypy-commit mailing list