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
a19a168c
Commit
a19a168c
authored
Mar 29, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace normalization.
parent
301ab7f2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
23 deletions
+23
-23
Lib/socket.py
Lib/socket.py
+1
-1
Lib/symtable.py
Lib/symtable.py
+4
-4
Lib/test/test_pty.py
Lib/test/test_pty.py
+1
-1
Lib/test/test_zipfile.py
Lib/test/test_zipfile.py
+4
-4
Lib/traceback.py
Lib/traceback.py
+1
-1
Lib/unittest.py
Lib/unittest.py
+7
-7
Lib/zipfile.py
Lib/zipfile.py
+5
-5
No files found.
Lib/socket.py
View file @
a19a168c
...
...
@@ -63,7 +63,7 @@ if (sys.platform.lower().startswith("win")
def
ssl
(
sock
,
keyfile
=
None
,
certfile
=
None
):
if
hasattr
(
sock
,
"_sock"
):
sock
=
sock
.
_sock
return
_realsslcall
(
sock
,
keyfile
,
certfile
)
return
_realsslcall
(
sock
,
keyfile
,
certfile
)
# WSA error codes
...
...
Lib/symtable.py
View file @
a19a168c
...
...
@@ -34,7 +34,7 @@ class SymbolTableFactory:
return
obj
newSymbolTable
=
SymbolTableFactory
()
def
bool
(
x
):
"""Helper to force boolean result to 1 or 0"""
if
x
:
...
...
@@ -60,7 +60,7 @@ class SymbolTable:
kind
=
""
else
:
kind
=
"%s "
%
self
.
__class__
.
__name__
if
self
.
_table
.
name
==
"global"
:
return
"<%sSymbolTable for module %s>"
%
(
kind
,
self
.
_filename
)
else
:
...
...
@@ -143,7 +143,7 @@ class Function(SymbolTable):
if
self
.
__locals
is
None
:
self
.
__locals
=
self
.
__idents_matching
(
lambda
x
:
x
&
DEF_BOUND
)
return
self
.
__locals
def
get_globals
(
self
):
if
self
.
__globals
is
None
:
glob
=
DEF_GLOBAL
|
DEF_FREE_GLOBAL
...
...
@@ -186,7 +186,7 @@ class Symbol:
return
bool
(
self
.
__flags
&
DEF_PARAM
)
def
is_global
(
self
):
return
bool
((
self
.
__flags
&
DEF_GLOBAL
)
return
bool
((
self
.
__flags
&
DEF_GLOBAL
)
or
(
self
.
__flags
&
DEF_FREE_GLOBAL
))
def
is_vararg
(
self
):
...
...
Lib/test/test_pty.py
View file @
a19a168c
...
...
@@ -60,7 +60,7 @@ if pid == pty.CHILD:
os
.
_exit
(
3
)
# After pty.fork(), the child should already be a session leader.
# (on those systems that have that concept.)
# (on those systems that have that concept.)
debug
(
"In child, calling os.setsid()"
)
try
:
os
.
setsid
()
...
...
Lib/test/test_zipfile.py
View file @
a19a168c
...
...
@@ -10,12 +10,12 @@ def zipTest(f, compression, srccontents):
zip
.
write
(
srcname
,
"another.name"
)
zip
.
write
(
srcname
,
srcname
)
zip
.
close
()
zip
=
zipfile
.
ZipFile
(
f
,
"r"
,
compression
)
# Read the ZIP archive
readData2
=
zip
.
read
(
srcname
)
readData1
=
zip
.
read
(
"another.name"
)
zip
.
close
()
if
readData1
!=
srccontents
or
readData2
!=
srccontents
:
raise
TestFailed
,
"Written data doesn't equal read data."
...
...
@@ -25,11 +25,11 @@ try:
for
i
in
range
(
0
,
1000
):
fp
.
write
(
"Test of zipfile line %d.
\
n
"
%
i
)
fp
.
close
()
fp
=
open
(
srcname
,
"rb"
)
writtenData
=
fp
.
read
()
fp
.
close
()
for
file
in
(
zipname
,
tempfile
.
TemporaryFile
(),
StringIO
.
StringIO
()):
zipTest
(
file
,
zipfile
.
ZIP_STORED
,
writtenData
)
...
...
Lib/traceback.py
View file @
a19a168c
...
...
@@ -221,7 +221,7 @@ def print_last(limit=None, file=None):
def
print_stack
(
f
=
None
,
limit
=
None
,
file
=
None
):
"""Print a stack trace from its invocation point.
The optional 'f' argument can be used to specify an alternate
stack frame at which to start. The optional 'limit' and 'file'
arguments have the same meaning as for print_exception().
...
...
Lib/unittest.py
View file @
a19a168c
...
...
@@ -103,7 +103,7 @@ class TestResult:
def
stop
(
self
):
"Indicates that the tests should be aborted"
self
.
shouldStop
=
1
def
__repr__
(
self
):
return
"<%s run=%i errors=%i failures=%i>"
%
\
(
self
.
__class__
,
self
.
testsRun
,
len
(
self
.
errors
),
...
...
@@ -116,12 +116,12 @@ class TestCase:
By default, the test code itself should be placed in a method named
'runTest'.
If the fixture may be used for many test cases, create as
If the fixture may be used for many test cases, create as
many test methods as are needed. When instantiating such a TestCase
subclass, specify in the constructor arguments the name of the test method
that the instance is to execute.
Test authors should subclass TestCase for their own tests. Construction
Test authors should subclass TestCase for their own tests. Construction
and deconstruction of the test's environment ('fixture') can be
implemented by overriding the 'setUp' and 'tearDown' methods respectively.
...
...
@@ -480,7 +480,7 @@ class _WritelnDecorator:
def
writeln
(
self
,
*
args
):
if
args
:
apply
(
self
.
write
,
args
)
self
.
write
(
'
\
n
'
)
# text-mode streams translate to \r\n if needed
class
_TextTestResult
(
TestResult
):
"""A test result class that can print formatted text results to a stream.
...
...
@@ -550,7 +550,7 @@ class _TextTestResult(TestResult):
class
TextTestRunner
:
"""A test runner class that displays results in textual form.
It prints out the names of tests as they are run, errors as they
occur, and a summary of the results at the end of the test run.
"""
...
...
@@ -587,7 +587,7 @@ class TextTestRunner:
else
:
self
.
stream
.
writeln
(
"OK"
)
return
result
##############################################################################
...
...
@@ -668,7 +668,7 @@ Examples:
if
self
.
testRunner
is
None
:
self
.
testRunner
=
TextTestRunner
(
verbosity
=
self
.
verbosity
)
result
=
self
.
testRunner
.
run
(
self
.
test
)
sys
.
exit
(
not
result
.
wasSuccessful
())
sys
.
exit
(
not
result
.
wasSuccessful
())
main
=
TestProgram
...
...
Lib/zipfile.py
View file @
a19a168c
...
...
@@ -131,10 +131,10 @@ class ZipInfo:
class
ZipFile
:
""" Class with methods to open, read, write, close, list zip files.
""" Class with methods to open, read, write, close, list zip files.
z = ZipFile(file, mode="r", compression=ZIP_STORED)
file: Either the path to the file, or a file-like object.
If it is a path, the file will be opened and closed by ZipFile.
mode: The mode can be either read "r", write "w" or append "a".
...
...
@@ -158,7 +158,7 @@ class ZipFile:
self
.
filelist
=
[]
# List of ZipInfo instances for archive
self
.
compression
=
compression
# Method of compression
self
.
mode
=
key
=
mode
[
0
]
# Check if we were passed a file-like object
if
type
(
file
)
in
_STRING_TYPES
:
self
.
_filePassed
=
0
...
...
@@ -169,7 +169,7 @@ class ZipFile:
self
.
_filePassed
=
1
self
.
fp
=
file
self
.
filename
=
getattr
(
file
,
'name'
,
None
)
if
key
==
'r'
:
self
.
_GetContents
()
elif
key
==
'w'
:
...
...
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