Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9e34c047
Commit
9e34c047
authored
Aug 26, 2005
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace normalization (via reindent.py).
parent
e8889c57
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
23 deletions
+19
-23
Lib/distutils/dir_util.py
Lib/distutils/dir_util.py
+1
-1
Lib/hashlib.py
Lib/hashlib.py
+0
-1
Lib/random.py
Lib/random.py
+1
-1
Lib/test/seq_tests.py
Lib/test/seq_tests.py
+1
-1
Lib/test/test_generators.py
Lib/test/test_generators.py
+3
-3
Lib/test/test_hashlib_speed.py
Lib/test/test_hashlib_speed.py
+0
-1
Lib/test/test_mmap.py
Lib/test/test_mmap.py
+1
-1
Lib/urllib2.py
Lib/urllib2.py
+2
-2
Tools/scripts/findnocoding.py
Tools/scripts/findnocoding.py
+6
-8
Tools/scripts/pysource.py
Tools/scripts/pysource.py
+4
-4
No files found.
Lib/distutils/dir_util.py
View file @
9e34c047
...
@@ -31,7 +31,7 @@ def mkpath (name, mode=0777, verbose=0, dry_run=0):
...
@@ -31,7 +31,7 @@ def mkpath (name, mode=0777, verbose=0, dry_run=0):
global
_path_created
global
_path_created
# Detect a common bug -- name is None
# Detect a common bug -- name is None
if
not
isinstance
(
name
,
StringTypes
):
if
not
isinstance
(
name
,
StringTypes
):
raise
DistutilsInternalError
,
\
raise
DistutilsInternalError
,
\
"mkpath: 'name' must be a string (got %r)"
%
(
name
,)
"mkpath: 'name' must be a string (got %r)"
%
(
name
,)
...
...
Lib/hashlib.py
View file @
9e34c047
...
@@ -107,4 +107,3 @@ except ImportError:
...
@@ -107,4 +107,3 @@ except ImportError:
sha256
=
__get_builtin_constructor
(
'sha256'
)
sha256
=
__get_builtin_constructor
(
'sha256'
)
sha384
=
__get_builtin_constructor
(
'sha384'
)
sha384
=
__get_builtin_constructor
(
'sha384'
)
sha512
=
__get_builtin_constructor
(
'sha512'
)
sha512
=
__get_builtin_constructor
(
'sha512'
)
Lib/random.py
View file @
9e34c047
...
@@ -303,7 +303,7 @@ class Random(_random.Random):
...
@@ -303,7 +303,7 @@ class Random(_random.Random):
result
=
[
None
]
*
k
result
=
[
None
]
*
k
setsize
=
21
# size of a small set minus size of an empty list
setsize
=
21
# size of a small set minus size of an empty list
if
k
>
5
:
if
k
>
5
:
setsize
+=
4
**
_ceil
(
_log
(
k
*
3
,
4
))
# table size for big sets
setsize
+=
4
**
_ceil
(
_log
(
k
*
3
,
4
))
# table size for big sets
if
n
<=
setsize
:
# is an n-length list smaller than a k-length set
if
n
<=
setsize
:
# is an n-length list smaller than a k-length set
pool
=
list
(
population
)
pool
=
list
(
population
)
for
i
in
xrange
(
k
):
# invariant: non-selected at [0,n-i)
for
i
in
xrange
(
k
):
# invariant: non-selected at [0,n-i)
...
...
Lib/test/seq_tests.py
View file @
9e34c047
...
@@ -228,7 +228,7 @@ class CommonTest(unittest.TestCase):
...
@@ -228,7 +228,7 @@ class CommonTest(unittest.TestCase):
class
StopCompares
:
class
StopCompares
:
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
raise
DoNotTestEq
raise
DoNotTestEq
checkfirst
=
self
.
type2test
([
1
,
StopCompares
()])
checkfirst
=
self
.
type2test
([
1
,
StopCompares
()])
self
.
assert_
(
1
in
checkfirst
)
self
.
assert_
(
1
in
checkfirst
)
checklast
=
self
.
type2test
([
StopCompares
(),
1
])
checklast
=
self
.
type2test
([
StopCompares
(),
1
])
...
...
Lib/test/test_generators.py
View file @
9e34c047
...
@@ -709,18 +709,18 @@ are quite straightforwardly expressed with this Python idiom.
...
@@ -709,18 +709,18 @@ are quite straightforwardly expressed with this Python idiom.
Ye olde Fibonacci generator, tee style.
Ye olde Fibonacci generator, tee style.
>>> def fib():
>>> def fib():
...
...
... def _isum(g, h):
... def _isum(g, h):
... while 1:
... while 1:
... yield g.next() + h.next()
... yield g.next() + h.next()
...
...
... def _fib():
... def _fib():
... yield 1
... yield 1
... yield 2
... yield 2
... fibTail.next() # throw first away
... fibTail.next() # throw first away
... for res in _isum(fibHead, fibTail):
... for res in _isum(fibHead, fibTail):
... yield res
... yield res
...
...
... fibHead, fibTail, fibRes = tee(_fib(), 3)
... fibHead, fibTail, fibRes = tee(_fib(), 3)
... return fibRes
... return fibRes
...
...
Lib/test/test_hashlib_speed.py
View file @
9e34c047
...
@@ -90,4 +90,3 @@ test_scaled_msg(scale=212, name='[2*small data]')
...
@@ -90,4 +90,3 @@ test_scaled_msg(scale=212, name='[2*small data]')
test_scaled_msg
(
scale
=
106
,
name
=
'[small data]'
)
test_scaled_msg
(
scale
=
106
,
name
=
'[small data]'
)
test_scaled_msg
(
scale
=
creatorFunc
().
digest_size
,
name
=
'[digest_size data]'
)
test_scaled_msg
(
scale
=
creatorFunc
().
digest_size
,
name
=
'[digest_size data]'
)
test_scaled_msg
(
scale
=
10
,
name
=
'[tiny data]'
)
test_scaled_msg
(
scale
=
10
,
name
=
'[tiny data]'
)
Lib/test/test_mmap.py
View file @
9e34c047
...
@@ -126,7 +126,7 @@ def test_both():
...
@@ -126,7 +126,7 @@ def test_both():
f
.
seek
(
0
,
2
)
f
.
seek
(
0
,
2
)
verify
(
f
.
tell
()
==
512
,
'Underlying file not truncated'
)
verify
(
f
.
tell
()
==
512
,
'Underlying file not truncated'
)
f
.
close
()
f
.
close
()
verify
(
m
.
size
()
==
512
,
'New size not reflected in file'
)
verify
(
m
.
size
()
==
512
,
'New size not reflected in file'
)
m
.
close
()
m
.
close
()
...
...
Lib/urllib2.py
View file @
9e34c047
...
@@ -1069,7 +1069,7 @@ def parse_keqv_list(l):
...
@@ -1069,7 +1069,7 @@ def parse_keqv_list(l):
def
parse_http_list
(
s
):
def
parse_http_list
(
s
):
"""Parse lists as described by RFC 2068 Section 2.
"""Parse lists as described by RFC 2068 Section 2.
In particular, parse comma-separated lists where the elements of
In particular, parse comma-separated lists where the elements of
the list may include quoted-strings. A quoted-string could
the list may include quoted-strings. A quoted-string could
contain a comma. A non-quoted string could have quotes in the
contain a comma. A non-quoted string could have quotes in the
...
@@ -1101,7 +1101,7 @@ def parse_http_list(s):
...
@@ -1101,7 +1101,7 @@ def parse_http_list(s):
if
cur
==
'"'
:
if
cur
==
'"'
:
quote
=
True
quote
=
True
part
+=
cur
part
+=
cur
# append last part
# append last part
...
...
Tools/scripts/findnocoding.py
View file @
9e34c047
...
@@ -26,8 +26,8 @@ except:
...
@@ -26,8 +26,8 @@ except:
if
filename
.
endswith
(
".py"
):
if
filename
.
endswith
(
".py"
):
yield
os
.
path
.
join
(
root
,
filename
)
yield
os
.
path
.
join
(
root
,
filename
)
pysource
=
pysource
()
pysource
=
pysource
()
print
>>
sys
.
stderr
,
(
"The pysource module is not available; "
print
>>
sys
.
stderr
,
(
"The pysource module is not available; "
"no sophisticated Python source file search will be done."
)
"no sophisticated Python source file search will be done."
)
...
@@ -56,19 +56,19 @@ def needs_declaration(fullpath):
...
@@ -56,19 +56,19 @@ def needs_declaration(fullpath):
line1
=
infile
.
readline
()
line1
=
infile
.
readline
()
line2
=
infile
.
readline
()
line2
=
infile
.
readline
()
if
get_declaration
(
line1
)
or
get_declaration
(
line2
):
if
get_declaration
(
line1
)
or
get_declaration
(
line2
):
# the file does have an encoding declaration, so trust it
# the file does have an encoding declaration, so trust it
infile
.
close
()
infile
.
close
()
return
False
return
False
# check the whole file for non-ASCII characters
# check the whole file for non-ASCII characters
rest
=
infile
.
read
()
rest
=
infile
.
read
()
infile
.
close
()
infile
.
close
()
if
has_correct_encoding
(
line1
+
line2
+
rest
,
"ascii"
):
if
has_correct_encoding
(
line1
+
line2
+
rest
,
"ascii"
):
return
False
return
False
return
True
return
True
...
@@ -102,5 +102,3 @@ for fullpath in pysource.walk_python_files(args, is_python):
...
@@ -102,5 +102,3 @@ for fullpath in pysource.walk_python_files(args, is_python):
result
=
needs_declaration
(
fullpath
)
result
=
needs_declaration
(
fullpath
)
if
result
:
if
result
:
print
fullpath
print
fullpath
Tools/scripts/pysource.py
View file @
9e34c047
...
@@ -57,12 +57,12 @@ def looks_like_python(fullpath):
...
@@ -57,12 +57,12 @@ def looks_like_python(fullpath):
line
=
infile
.
readline
()
line
=
infile
.
readline
()
infile
.
close
()
infile
.
close
()
if
binary_re
.
search
(
line
):
if
binary_re
.
search
(
line
):
# file appears to be binary
# file appears to be binary
print_debug
(
"%s: appears to be binary"
%
fullpath
)
print_debug
(
"%s: appears to be binary"
%
fullpath
)
return
False
return
False
if
fullpath
.
endswith
(
".py"
)
or
fullpath
.
endswith
(
".pyw"
):
if
fullpath
.
endswith
(
".py"
)
or
fullpath
.
endswith
(
".pyw"
):
return
True
return
True
elif
"python"
in
line
:
elif
"python"
in
line
:
...
@@ -95,12 +95,12 @@ def walk_python_files(paths, is_python=looks_like_python, exclude_dirs=None):
...
@@ -95,12 +95,12 @@ def walk_python_files(paths, is_python=looks_like_python, exclude_dirs=None):
paths: a list of files and/or directories to be checked.
paths: a list of files and/or directories to be checked.
is_python: a function that takes a file name and checks whether it is a
is_python: a function that takes a file name and checks whether it is a
Python source file
Python source file
exclude_dirs: a list of directory base names that should be excluded in
exclude_dirs: a list of directory base names that should be excluded in
the search
the search
"""
"""
if
exclude_dirs
is
None
:
if
exclude_dirs
is
None
:
exclude_dirs
=
[]
exclude_dirs
=
[]
for
path
in
paths
:
for
path
in
paths
:
print_debug
(
"testing: %s"
%
path
)
print_debug
(
"testing: %s"
%
path
)
if
os
.
path
.
isfile
(
path
):
if
os
.
path
.
isfile
(
path
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment