[Python-checkins] r87006 - in python/branches/release31-maint: Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/main.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/test_refactor.py Lib/lib2to3/tests/test_util.py

benjamin.peterson python-checkins at python.org
Sat Dec 4 03:24:43 CET 2010


Author: benjamin.peterson
Date: Sat Dec 4 03:24:43 2010
New Revision: 87006
Log:
Merged revisions 87002 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
 r87002 | martin.v.loewis | 2010年12月03日 17:11:07 -0600 (2010年12月03日) | 21 lines
 
 Merged revisions 85551,86156-86157,86464 via svnmerge from 
 svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
 
 ........
 r85551 | benjamin.peterson | 2010年10月15日 23:57:29 +0200 (Fr, 15 Okt 2010) | 1 line
 
 escape() is now in the html module
 ........
 r86156 | georg.brandl | 2010年11月04日 09:34:57 +0100 (Do, 04 Nov 2010) | 1 line
 
 Consistency fixes in option parser help texts.
 ........
 r86157 | georg.brandl | 2010年11月04日 09:35:30 +0100 (Do, 04 Nov 2010) | 1 line
 
 #10286: fix urllib class names.
 ........
 r86464 | benjamin.peterson | 2010年11月14日 16:28:52 +0100 (So, 14 Nov 2010) | 1 line
 
 match only .py files #10416
 ........
................
Modified:
 python/branches/release31-maint/ (props changed)
 python/branches/release31-maint/Lib/lib2to3/fixes/fix_urllib.py
 python/branches/release31-maint/Lib/lib2to3/main.py
 python/branches/release31-maint/Lib/lib2to3/refactor.py
 python/branches/release31-maint/Lib/lib2to3/tests/test_refactor.py
 python/branches/release31-maint/Lib/lib2to3/tests/test_util.py
Modified: python/branches/release31-maint/Lib/lib2to3/fixes/fix_urllib.py
==============================================================================
--- python/branches/release31-maint/Lib/lib2to3/fixes/fix_urllib.py	(original)
+++ python/branches/release31-maint/Lib/lib2to3/fixes/fix_urllib.py	Sat Dec 4 03:24:43 2010
@@ -12,7 +12,7 @@
 
 MAPPING = {"urllib": [
 ("urllib.request",
- ["URLOpener", "FancyURLOpener", "urlretrieve",
+ ["URLopener", "FancyURLopener", "urlretrieve",
 "_urlopener", "urlopen", "urlcleanup",
 "pathname2url", "url2pathname"]),
 ("urllib.parse",
Modified: python/branches/release31-maint/Lib/lib2to3/main.py
==============================================================================
--- python/branches/release31-maint/Lib/lib2to3/main.py	(original)
+++ python/branches/release31-maint/Lib/lib2to3/main.py	Sat Dec 4 03:24:43 2010
@@ -100,7 +100,7 @@
 parser.add_option("-j", "--processes", action="store", default=1,
 type="int", help="Run 2to3 concurrently")
 parser.add_option("-x", "--nofix", action="append", default=[],
- help="Prevent a fixer from being run.")
+ help="Prevent a transformation from being run")
 parser.add_option("-l", "--list-fixes", action="store_true",
 help="List available transformations")
 parser.add_option("-p", "--print-function", action="store_true",
@@ -112,7 +112,7 @@
 parser.add_option("-w", "--write", action="store_true",
 help="Write back modified files")
 parser.add_option("-n", "--nobackups", action="store_true", default=False,
- help="Don't write backups for modified files.")
+ help="Don't write backups for modified files")
 
 # Parse command line arguments
 refactor_stdin = False
Modified: python/branches/release31-maint/Lib/lib2to3/refactor.py
==============================================================================
--- python/branches/release31-maint/Lib/lib2to3/refactor.py	(original)
+++ python/branches/release31-maint/Lib/lib2to3/refactor.py	Sat Dec 4 03:24:43 2010
@@ -302,13 +302,14 @@
 
 Files and subdirectories starting with '.' are skipped.
 """
+ py_ext = os.extsep + "py"
 for dirpath, dirnames, filenames in os.walk(dir_name):
 self.log_debug("Descending into %s", dirpath)
 dirnames.sort()
 filenames.sort()
 for name in filenames:
- if not name.startswith(".") and \
- os.path.splitext(name)[1].endswith("py"):
+ if (not name.startswith(".") and
+ os.path.splitext(name)[1] == py_ext):
 fullname = os.path.join(dirpath, name)
 self.refactor_file(fullname, write, doctests_only)
 # Modify dirnames in-place to remove subdirs with leading dots
Modified: python/branches/release31-maint/Lib/lib2to3/tests/test_refactor.py
==============================================================================
--- python/branches/release31-maint/Lib/lib2to3/tests/test_refactor.py	(original)
+++ python/branches/release31-maint/Lib/lib2to3/tests/test_refactor.py	Sat Dec 4 03:24:43 2010
@@ -223,6 +223,7 @@
 "hi.py",
 ".dumb",
 ".after.py",
+ "notpy.npy",
 "sappy"]
 expected = ["hi.py"]
 check(tree, expected)
Modified: python/branches/release31-maint/Lib/lib2to3/tests/test_util.py
==============================================================================
--- python/branches/release31-maint/Lib/lib2to3/tests/test_util.py	(original)
+++ python/branches/release31-maint/Lib/lib2to3/tests/test_util.py	Sat Dec 4 03:24:43 2010
@@ -568,8 +568,8 @@
 
 def test_from_import(self):
 node = parse('bar()')
- fixer_util.touch_import("cgi", "escape", node)
- self.assertEqual(str(node), 'from cgi import escape\nbar()\n\n')
+ fixer_util.touch_import("html", "escape", node)
+ self.assertEqual(str(node), 'from html import escape\nbar()\n\n')
 
 def test_name_import(self):
 node = parse('bar()')


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /