Skip to content

Commit a8c053f

Browse files
author
benjamin.peterson
committed
Merged revisions 68306-68308,68340,68368,68422 via svnmerge from
svn+ssh://[email protected]/sandbox/trunk/2to3/lib2to3 ........ r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line fix_urllib: add mappings for the url parsing functions ........ r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line remove duplicated function ........ r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line turtle is no longer renamed ........ r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines Fix undefined locals in parse_tokens(). ........ r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line fix typo (thanks to Robert Lehmann) ........ r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876 ........ git-svn-id: http://svn.python.org/projects/python/trunk@68423 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent d691ec3 commit a8c053f

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

Lib/lib2to3/fixes/fix_imports.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
'tkFont': 'tkinter.font',
2626
'tkMessageBox': 'tkinter.messagebox',
2727
'ScrolledText': 'tkinter.scrolledtext',
28-
'turtle': 'tkinter.turtle',
2928
'Tkconstants': 'tkinter.constants',
3029
'Tix': 'tkinter.tix',
3130
'Tkinter': 'tkinter',
@@ -89,6 +88,10 @@ class FixImports(fixer_base.BaseFix):
8988
# This is overridden in fix_imports2.
9089
mapping = MAPPING
9190

91+
# We want to run this fixer late, so fix_import doesn't try to make stdlib
92+
# renames into relative imports.
93+
run_order = 6
94+
9295
def build_pattern(self):
9396
return "|".join(build_pattern(self.mapping))
9497

Lib/lib2to3/fixes/fix_imports2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
class FixImports2(fix_imports.FixImports):
1313

14-
run_order = 6
14+
run_order = 7
1515

1616
mapping = MAPPING

Lib/lib2to3/fixes/fix_urllib.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
'_urlopener', 'urlcleanup']),
1616
('urllib.parse',
1717
['quote', 'quote_plus', 'unquote', 'unquote_plus',
18-
'urlencode', 'pahtname2url', 'url2pathname']),
18+
'urlencode', 'pathname2url', 'url2pathname', 'splitattr',
19+
'splithost', 'splitnport', 'splitpasswd', 'splitport',
20+
'splitquery', 'splittag', 'splittype', 'splituser',
21+
'splitvalue', ]),
1922
('urllib.error',
2023
['ContentTooShortError'])],
2124
'urllib2' : [
@@ -34,12 +37,12 @@
3437
'FTPHandler', 'CacheFTPHandler',
3538
'UnknownHandler']),
3639
('urllib.error',
37-
['URLError', 'HTTPError'])],
40+
['URLError', 'HTTPError']),
41+
]
3842
}
3943

40-
41-
# def alternates(members):
42-
# return "(" + "|".join(map(repr, members)) + ")"
44+
# Duplicate the url parsing functions for urllib2.
45+
MAPPING["urllib2"].append(MAPPING["urllib"][1])
4346

4447

4548
def build_pattern():

Lib/lib2to3/pgen2/driver.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def parse_tokens(self, tokens, debug=False):
7777
column = 0
7878
else:
7979
# We never broke out -- EOF is too soon (how can this happen???)
80-
raise parse.ParseError("incomplete input", t, v, x)
80+
raise parse.ParseError("incomplete input",
81+
type, value, (prefix, start))
8182
return p.rootnode
8283

8384
def parse_stream_raw(self, stream, debug=False):

0 commit comments

Comments
 (0)