mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Whitespace normalization (via reindent.py).
This commit is contained in:
parent
e8889c5741
commit
9e34c04732
10 changed files with 19 additions and 23 deletions
|
@ -26,8 +26,8 @@ except:
|
|||
if filename.endswith(".py"):
|
||||
yield os.path.join(root, filename)
|
||||
pysource = pysource()
|
||||
|
||||
|
||||
|
||||
|
||||
print >>sys.stderr, ("The pysource module is not available; "
|
||||
"no sophisticated Python source file search will be done.")
|
||||
|
||||
|
@ -56,19 +56,19 @@ def needs_declaration(fullpath):
|
|||
|
||||
line1 = infile.readline()
|
||||
line2 = infile.readline()
|
||||
|
||||
|
||||
if get_declaration(line1) or get_declaration(line2):
|
||||
# the file does have an encoding declaration, so trust it
|
||||
infile.close()
|
||||
return False
|
||||
|
||||
|
||||
# check the whole file for non-ASCII characters
|
||||
rest = infile.read()
|
||||
infile.close()
|
||||
|
||||
|
||||
if has_correct_encoding(line1+line2+rest, "ascii"):
|
||||
return False
|
||||
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
@ -102,5 +102,3 @@ for fullpath in pysource.walk_python_files(args, is_python):
|
|||
result = needs_declaration(fullpath)
|
||||
if result:
|
||||
print fullpath
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue