diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2010-12-03 23:11:07 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2010-12-03 23:11:07 (GMT) |
commit | e2bb4eb77b24a1870bd7feb15124b7adf1460efe (patch) | |
tree | 4ae64d985e9109ae08174e24158547bcc68bcda9 /Lib/lib2to3/refactor.py | |
parent | 4b9b19751816cb3976263a12dfcc0caa5feb2bf4 (diff) | |
download | cpython-e2bb4eb77b24a1870bd7feb15124b7adf1460efe.zip cpython-e2bb4eb77b24a1870bd7feb15124b7adf1460efe.tar.gz cpython-e2bb4eb77b24a1870bd7feb15124b7adf1460efe.tar.bz2 |
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
........
Diffstat (limited to 'Lib/lib2to3/refactor.py')
-rw-r--r-- | Lib/lib2to3/refactor.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py index 54e00ee..ae5e40f 100644 --- a/Lib/lib2to3/refactor.py +++ b/Lib/lib2to3/refactor.py @@ -302,13 +302,14 @@ class RefactoringTool(object): 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 |