[Python-checkins] r54311 - sandbox/trunk/2to3/pgen2/tokenize.py

collin.winter python-checkins at python.org
Mon Mar 12 22:17:17 CET 2007


Author: collin.winter
Date: Mon Mar 12 22:17:13 2007
New Revision: 54311

Modified:
   sandbox/trunk/2to3/pgen2/tokenize.py
Log:
Make 2to3 work with Python 2.4.

Modified: sandbox/trunk/2to3/pgen2/tokenize.py
==============================================================================
--- sandbox/trunk/2to3/pgen2/tokenize.py	(original)
+++ sandbox/trunk/2to3/pgen2/tokenize.py	Mon Mar 12 22:17:13 2007
@@ -334,8 +334,10 @@
                    (initial == '.' and token != '.'):      # ordinary number
                     yield (NUMBER, token, spos, epos, line)
                 elif initial in '\r\n':
-                    yield (NL if parenlev > 0 else NEWLINE,
-                           token, spos, epos, line)
+                    newline = NEWLINE
+                    if parenlev > 0:
+                        newline = NL
+                    yield (newline, token, spos, epos, line)
                 elif initial == '#':
                     assert not token.endswith("\n")
                     yield (COMMENT, token, spos, epos, line)


More information about the Python-checkins mailing list