diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-02-26 22:12:10 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-02-26 22:12:10 (GMT) |
commit | 2e7965e8b001826f6381877aa8a9ec60574b3ca3 (patch) | |
tree | d1d6ebb4525ce03b0e4ca184b8f9960fc5ebb06f /Lib/lib2to3/patcomp.py | |
parent | d8a43b4a4bc00e47a0e57fa11bec4f05f0d86dec (diff) | |
download | cpython-2e7965e8b001826f6381877aa8a9ec60574b3ca3.zip cpython-2e7965e8b001826f6381877aa8a9ec60574b3ca3.tar.gz cpython-2e7965e8b001826f6381877aa8a9ec60574b3ca3.tar.bz2 |
Merged revisions 88661 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r88661 | benjamin.peterson | 2011-02-26 16:06:24 -0600 (Sat, 26 Feb 2011) | 6 lines
fix refactoring on formfeed characters #11250
This is because text.splitlines() is not the same as
list(StringIO.StringIO(text)).
........
Diffstat (limited to 'Lib/lib2to3/patcomp.py')
-rw-r--r-- | Lib/lib2to3/patcomp.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/lib2to3/patcomp.py b/Lib/lib2to3/patcomp.py index bb538d5..0a259e9 100644 --- a/Lib/lib2to3/patcomp.py +++ b/Lib/lib2to3/patcomp.py @@ -11,6 +11,7 @@ The compiler compiles a pattern to a pytree.*Pattern instance. __author__ = "Guido van Rossum <guido@python.org>" # Python imports +import io import os # Fairly local imports @@ -32,7 +33,7 @@ class PatternSyntaxError(Exception): def tokenize_wrapper(input): """Tokenizes a string suppressing significant whitespace.""" skip = set((token.NEWLINE, token.INDENT, token.DEDENT)) - tokens = tokenize.generate_tokens(driver.generate_lines(input).__next__) + tokens = tokenize.generate_tokens(io.StringIO(input).readline) for quintuple in tokens: type, value, start, end, line_text = quintuple if type not in skip: |