summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-09 03:04:01 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-09 03:04:01 (GMT)
commit9f7ae1b8c3ffd6b9e2ea988f68857a3ba8456949 (patch)
tree99705df8fe746ec239d531783182114d84e3571b /Lib/lib2to3
parentb2f2291182820110d70ef38b29fbf13c97012861 (diff)
downloadcpython-9f7ae1b8c3ffd6b9e2ea988f68857a3ba8456949.zip
cpython-9f7ae1b8c3ffd6b9e2ea988f68857a3ba8456949.tar.gz
cpython-9f7ae1b8c3ffd6b9e2ea988f68857a3ba8456949.tar.bz2
Merged revisions 68288-68291,68325-68326,68338,68388,68393,68423 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ................ r68288 | benjamin.peterson | 2009-01-03 18:39:07 -0600 (Sat, 03 Jan 2009) | 1 line only check the actual compile() call for a SyntaxError ................ r68289 | georg.brandl | 2009-01-04 02:26:10 -0600 (Sun, 04 Jan 2009) | 2 lines Test commit. ................ r68290 | georg.brandl | 2009-01-04 04:23:49 -0600 (Sun, 04 Jan 2009) | 4 lines Add "suspicious" builder which finds leftover markup in the HTML files. Patch by Gabriel Genellina. ................ r68291 | georg.brandl | 2009-01-04 04:24:09 -0600 (Sun, 04 Jan 2009) | 2 lines Fix two issues found by the suspicious builder. ................ r68325 | benjamin.peterson | 2009-01-04 16:00:18 -0600 (Sun, 04 Jan 2009) | 1 line use Jinja 2.1.1 ................ r68326 | georg.brandl | 2009-01-04 16:03:10 -0600 (Sun, 04 Jan 2009) | 2 lines Update make.bat. ................ r68338 | neal.norwitz | 2009-01-04 21:57:25 -0600 (Sun, 04 Jan 2009) | 1 line Make sure to checkout any new packages ................ r68388 | benjamin.peterson | 2009-01-07 21:39:46 -0600 (Wed, 07 Jan 2009) | 1 line string exceptions are gone ................ r68393 | benjamin.peterson | 2009-01-07 22:01:00 -0600 (Wed, 07 Jan 2009) | 1 line use new sphinx modules ................ r68423 | benjamin.peterson | 2009-01-08 20:13:34 -0600 (Thu, 08 Jan 2009) | 29 lines Merged revisions 68306-68308,68340,68368,68422 via svnmerge from svn+ssh://pythondev@svn.python.org/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 ........ ................
Diffstat (limited to 'Lib/lib2to3')
-rw-r--r--Lib/lib2to3/fixes/fix_imports.py5
-rw-r--r--Lib/lib2to3/fixes/fix_imports2.py2
-rw-r--r--Lib/lib2to3/fixes/fix_urllib.py13
-rw-r--r--Lib/lib2to3/pgen2/driver.py3
4 files changed, 15 insertions, 8 deletions
diff --git a/Lib/lib2to3/fixes/fix_imports.py b/Lib/lib2to3/fixes/fix_imports.py
index 98d4406..08be543 100644
--- a/Lib/lib2to3/fixes/fix_imports.py
+++ b/Lib/lib2to3/fixes/fix_imports.py
@@ -25,7 +25,6 @@ MAPPING = {'StringIO': 'io',
'tkFont': 'tkinter.font',
'tkMessageBox': 'tkinter.messagebox',
'ScrolledText': 'tkinter.scrolledtext',
- 'turtle': 'tkinter.turtle',
'Tkconstants': 'tkinter.constants',
'Tix': 'tkinter.tix',
'Tkinter': 'tkinter',
@@ -89,6 +88,10 @@ class FixImports(fixer_base.BaseFix):
# This is overridden in fix_imports2.
mapping = MAPPING
+ # We want to run this fixer late, so fix_import doesn't try to make stdlib
+ # renames into relative imports.
+ run_order = 6
+
def build_pattern(self):
return "|".join(build_pattern(self.mapping))
diff --git a/Lib/lib2to3/fixes/fix_imports2.py b/Lib/lib2to3/fixes/fix_imports2.py
index 477bafd..9a33c67 100644
--- a/Lib/lib2to3/fixes/fix_imports2.py
+++ b/Lib/lib2to3/fixes/fix_imports2.py
@@ -11,6 +11,6 @@ MAPPING = {
class FixImports2(fix_imports.FixImports):
- run_order = 6
+ run_order = 7
mapping = MAPPING
diff --git a/Lib/lib2to3/fixes/fix_urllib.py b/Lib/lib2to3/fixes/fix_urllib.py
index 1e74bff..89abfc4 100644
--- a/Lib/lib2to3/fixes/fix_urllib.py
+++ b/Lib/lib2to3/fixes/fix_urllib.py
@@ -15,7 +15,10 @@ MAPPING = {'urllib': [
'_urlopener', 'urlcleanup']),
('urllib.parse',
['quote', 'quote_plus', 'unquote', 'unquote_plus',
- 'urlencode', 'pahtname2url', 'url2pathname']),
+ 'urlencode', 'pathname2url', 'url2pathname', 'splitattr',
+ 'splithost', 'splitnport', 'splitpasswd', 'splitport',
+ 'splitquery', 'splittag', 'splittype', 'splituser',
+ 'splitvalue', ]),
('urllib.error',
['ContentTooShortError'])],
'urllib2' : [
@@ -34,12 +37,12 @@ MAPPING = {'urllib': [
'FTPHandler', 'CacheFTPHandler',
'UnknownHandler']),
('urllib.error',
- ['URLError', 'HTTPError'])],
+ ['URLError', 'HTTPError']),
+ ]
}
-
-# def alternates(members):
-# return "(" + "|".join(map(repr, members)) + ")"
+# Duplicate the url parsing functions for urllib2.
+MAPPING["urllib2"].append(MAPPING["urllib"][1])
def build_pattern():
diff --git a/Lib/lib2to3/pgen2/driver.py b/Lib/lib2to3/pgen2/driver.py
index b08f1d7..3cff0ac 100644
--- a/Lib/lib2to3/pgen2/driver.py
+++ b/Lib/lib2to3/pgen2/driver.py
@@ -77,7 +77,8 @@ class Driver(object):
column = 0
else:
# We never broke out -- EOF is too soon (how can this happen???)
- raise parse.ParseError("incomplete input", t, v, x)
+ raise parse.ParseError("incomplete input",
+ type, value, (prefix, start))
return p.rootnode
def parse_stream_raw(self, stream, debug=False):