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
527bbc12
Commit
527bbc12
authored
Jan 18, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace normalization.
parent
8bf04790
Changes
34
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
69 additions
and
76 deletions
+69
-76
Lib/StringIO.py
Lib/StringIO.py
+1
-1
Lib/_strptime.py
Lib/_strptime.py
+1
-1
Lib/distutils/command/build_ext.py
Lib/distutils/command/build_ext.py
+2
-1
Lib/httplib.py
Lib/httplib.py
+2
-2
Lib/random.py
Lib/random.py
+1
-1
Lib/sre_parse.py
Lib/sre_parse.py
+2
-2
Lib/test/pystone.py
Lib/test/pystone.py
+0
-1
Lib/test/test_applesingle.py
Lib/test/test_applesingle.py
+1
-1
Lib/test/test_codeccallbacks.py
Lib/test/test_codeccallbacks.py
+1
-1
Lib/test/test_codecencodings_cn.py
Lib/test/test_codecencodings_cn.py
+2
-3
Lib/test/test_codecencodings_jp.py
Lib/test/test_codecencodings_jp.py
+0
-1
Lib/test/test_codecencodings_kr.py
Lib/test/test_codecencodings_kr.py
+0
-1
Lib/test/test_codecencodings_tw.py
Lib/test/test_codecencodings_tw.py
+0
-1
Lib/test/test_codecmaps_cn.py
Lib/test/test_codecmaps_cn.py
+0
-1
Lib/test/test_codecmaps_jp.py
Lib/test/test_codecmaps_jp.py
+0
-1
Lib/test/test_codecmaps_kr.py
Lib/test/test_codecmaps_kr.py
+0
-1
Lib/test/test_codecmaps_tw.py
Lib/test/test_codecmaps_tw.py
+0
-1
Lib/test/test_curses.py
Lib/test/test_curses.py
+2
-2
Lib/test/test_descr.py
Lib/test/test_descr.py
+1
-1
Lib/test/test_difflib.py
Lib/test/test_difflib.py
+0
-1
Lib/test/test_marshal.py
Lib/test/test_marshal.py
+4
-4
Lib/test/test_md5.py
Lib/test/test_md5.py
+2
-2
Lib/test/test_multibytecodec.py
Lib/test/test_multibytecodec.py
+0
-1
Lib/test/test_multibytecodec_support.py
Lib/test/test_multibytecodec_support.py
+0
-1
Lib/test/test_os.py
Lib/test/test_os.py
+3
-3
Lib/test/test_re.py
Lib/test/test_re.py
+1
-1
Lib/test/test_set.py
Lib/test/test_set.py
+1
-1
Lib/test/test_sort.py
Lib/test/test_sort.py
+0
-2
Lib/test/test_support.py
Lib/test/test_support.py
+1
-1
Lib/test/test_unicode_file.py
Lib/test/test_unicode_file.py
+3
-3
Lib/test/test_urllib2.py
Lib/test/test_urllib2.py
+21
-19
Lib/traceback.py
Lib/traceback.py
+1
-1
Lib/urllib2.py
Lib/urllib2.py
+7
-7
Objects/listobject.c
Objects/listobject.c
+9
-5
No files found.
Lib/StringIO.py
View file @
527bbc12
Lib/_strptime.py
View file @
527bbc12
Lib/distutils/command/build_ext.py
View file @
527bbc12
...
...
@@ -171,7 +171,8 @@ class build_ext (Command):
# Append the source distribution include and library directories,
# this allows distutils on windows to work in the source tree
self
.
include_dirs
.
append
(
os
.
path
.
join
(
sys
.
exec_prefix
,
'PC'
))
self
.
library_dirs
.
append
(
os
.
path
.
join
(
sys
.
exec_prefix
,
'PCBuild'
))
self
.
library_dirs
.
append
(
os
.
path
.
join
(
sys
.
exec_prefix
,
'PC'
,
'VC6'
))
#self.library_dirs.append(os.path.join(sys.exec_prefix, 'PCBuild'))
# OS/2 (EMX) doesn't support Debug vs Release builds, but has the
# import libraries in its "Config" subdirectory
...
...
Lib/httplib.py
View file @
527bbc12
Lib/random.py
View file @
527bbc12
Lib/sre_parse.py
View file @
527bbc12
Lib/test/pystone.py
View file @
527bbc12
...
...
@@ -264,4 +264,3 @@ if __name__ == '__main__':
else
:
loops
=
LOOPS
main
(
loops
)
Lib/test/test_applesingle.py
View file @
527bbc12
Lib/test/test_codeccallbacks.py
View file @
527bbc12
Lib/test/test_codecencodings_cn.py
View file @
527bbc12
...
...
@@ -58,4 +58,3 @@ def test_main():
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_codecencodings_jp.py
View file @
527bbc12
...
...
@@ -131,4 +131,3 @@ def test_main():
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_codecencodings_kr.py
View file @
527bbc12
...
...
@@ -54,4 +54,3 @@ def test_main():
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_codecencodings_tw.py
View file @
527bbc12
...
...
@@ -28,4 +28,3 @@ def test_main():
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_codecmaps_cn.py
View file @
527bbc12
...
...
@@ -31,4 +31,3 @@ def test_main():
test_multibytecodec_support
.
register_skip_expected
(
TestGB2312Map
,
TestGBKMap
)
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_codecmaps_jp.py
View file @
527bbc12
...
...
@@ -87,4 +87,3 @@ test_multibytecodec_support.register_skip_expected(TestCP932Map,
TestSJISX0213Map
)
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_codecmaps_kr.py
View file @
527bbc12
...
...
@@ -48,4 +48,3 @@ test_multibytecodec_support.register_skip_expected(TestCP949Map,
TestEUCKRMap
,
TestJOHABMap
)
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_codecmaps_tw.py
View file @
527bbc12
...
...
@@ -36,4 +36,3 @@ def test_main():
test_multibytecodec_support
.
register_skip_expected
(
TestBIG5Map
,
TestCP950Map
)
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_curses.py
View file @
527bbc12
Lib/test/test_descr.py
View file @
527bbc12
Lib/test/test_difflib.py
View file @
527bbc12
...
...
@@ -15,4 +15,3 @@ class TestSFbugs(unittest.TestCase):
Doctests
=
doctest
.
DocTestSuite
(
difflib
)
test_support
.
run_unittest
(
TestSFbugs
,
Doctests
)
Lib/test/test_marshal.py
View file @
527bbc12
Lib/test/test_md5.py
View file @
527bbc12
Lib/test/test_multibytecodec.py
View file @
527bbc12
...
...
@@ -76,4 +76,3 @@ def test_main():
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_multibytecodec_support.py
View file @
527bbc12
...
...
@@ -230,4 +230,3 @@ def register_skip_expected(*cases):
break
else
:
sys
.
modules
[
case
.
__module__
].
skip_expected
=
False
Lib/test/test_os.py
View file @
527bbc12
Lib/test/test_re.py
View file @
527bbc12
Lib/test/test_set.py
View file @
527bbc12
Lib/test/test_sort.py
View file @
527bbc12
...
...
@@ -270,5 +270,3 @@ def test_main(verbose=None):
if
__name__
==
"__main__"
:
test_main
(
verbose
=
True
)
Lib/test/test_support.py
View file @
527bbc12
Lib/test/test_unicode_file.py
View file @
527bbc12
Lib/test/test_urllib2.py
View file @
527bbc12
...
...
@@ -269,6 +269,14 @@ class OpenerDirectorTests(unittest.TestCase):
isinstance
(
args
[
1
],
MockResponse
))
def
sanepathname2url
(
path
):
import
urllib
urlpath
=
urllib
.
pathname2url
(
path
)
if
os
.
name
==
"nt"
and
urlpath
.
startswith
(
"///"
):
urlpath
=
urlpath
[
2
:]
# XXX don't ask me about the mac...
return
urlpath
class
HandlerTests
(
unittest
.
TestCase
):
def
test_ftp
(
self
):
...
...
@@ -323,19 +331,17 @@ class HandlerTests(unittest.TestCase):
h
=
urllib2
.
FileHandler
()
o
=
h
.
parent
=
MockOpener
()
#from test_support import
TESTFN
TESTFN
=
"test.txt"
TESTFN
=
test_support
.
TESTFN
urlpath
=
sanepathname2url
(
os
.
path
.
abspath
(
TESTFN
))
towrite
=
"hello, world
\
n
"
for
url
in
[
"file://localhost%s/%s"
%
(
os
.
getcwd
(),
TESTFN
),
"file://%s/%s"
%
(
os
.
getcwd
(),
TESTFN
),
"file://%s%s/%s"
%
(
socket
.
gethostbyname
(
'localhost'
),
os
.
getcwd
(),
TESTFN
),
"file://%s%s/%s"
%
(
socket
.
gethostbyname
(
socket
.
gethostname
()),
os
.
getcwd
(),
TESTFN
),
# XXX Windows / Mac format(s), ... ?
"file://localhost%s"
%
urlpath
,
"file://%s"
%
urlpath
,
"file://%s%s"
%
(
socket
.
gethostbyname
(
'localhost'
),
urlpath
),
"file://%s%s"
%
(
socket
.
gethostbyname
(
socket
.
gethostname
()),
urlpath
),
]:
f
=
open
(
TESTFN
,
"w"
)
f
=
open
(
TESTFN
,
"w
b
"
)
try
:
try
:
f
.
write
(
towrite
)
...
...
@@ -345,25 +351,21 @@ class HandlerTests(unittest.TestCase):
r
=
h
.
file_open
(
Request
(
url
))
try
:
data
=
r
.
read
()
read_time
=
time
.
time
()
headers
=
r
.
info
()
newurl
=
r
.
geturl
()
finally
:
r
.
close
()
stats
=
os
.
stat
(
TESTFN
)
modified
=
rfc822
.
formatdate
(
stats
.
st_mtime
)
finally
:
os
.
remove
(
TESTFN
)
self
.
assertEqual
(
data
,
towrite
)
self
.
assertEqual
(
headers
[
"Content-type"
],
"text/plain"
)
self
.
assertEqual
(
headers
[
"Content-length"
],
"13"
)
# Fudge Last-modified string comparison by one second to
# prevent spurious failure on crossing a second boundary while
# executing this test.
unfudged
=
rfc822
.
formatdate
(
read_time
)
fudged
=
rfc822
.
formatdate
(
read_time
-
1
)
self
.
assert_
(
headers
[
"Last-modified"
]
in
[
unfudged
,
fudged
])
self
.
assertEqual
(
headers
[
"Last-modified"
],
modified
)
for
url
in
[
"file://localhost:80%s
/%s"
%
(
os
.
getcwd
(),
TESTFN
)
,
"file://localhost:80%s
"
%
urlpath
,
# XXXX bug: these fail with socket.gaierror, should be URLError
## "file://%s:80%s/%s" % (socket.gethostbyname('localhost'),
## os.getcwd(), TESTFN),
...
...
@@ -371,7 +373,7 @@ class HandlerTests(unittest.TestCase):
## (os.getcwd(), TESTFN),
]:
try
:
f
=
open
(
TESTFN
,
"w"
)
f
=
open
(
TESTFN
,
"w
b
"
)
try
:
f
.
write
(
towrite
)
finally
:
...
...
Lib/traceback.py
View file @
527bbc12
Lib/urllib2.py
View file @
527bbc12
Objects/listobject.c
View file @
527bbc12
...
...
@@ -57,13 +57,15 @@ PyList_New(int size)
{
PyListObject
*
op
;
size_t
nbytes
;
int
allocated_size
=
roundupsize
(
size
);
if
(
size
<
0
)
{
PyErr_BadInternalCall
();
return
NULL
;
}
nbytes
=
size
*
sizeof
(
PyObject
*
);
nbytes
=
allocated_
size
*
sizeof
(
PyObject
*
);
/* Check for overflow */
if
(
nbytes
/
sizeof
(
PyObject
*
)
!=
(
size_t
)
size
)
{
if
(
nbytes
/
sizeof
(
PyObject
*
)
!=
(
size_t
)
allocated_
size
)
{
return
PyErr_NoMemory
();
}
op
=
PyObject_GC_New
(
PyListObject
,
&
PyList_Type
);
...
...
@@ -78,7 +80,7 @@ PyList_New(int size)
if
(
op
->
ob_item
==
NULL
)
{
return
PyErr_NoMemory
();
}
memset
(
op
->
ob_item
,
0
,
sizeof
(
*
op
->
ob_item
)
*
size
);
memset
(
op
->
ob_item
,
0
,
sizeof
(
*
op
->
ob_item
)
*
allocated_
size
);
}
op
->
ob_size
=
size
;
_PyObject_GC_TRACK
(
op
);
...
...
@@ -154,6 +156,7 @@ ins1(PyListObject *self, int where, PyObject *v)
return
-
1
;
}
items
=
self
->
ob_item
;
if
(
roundupsize
(
self
->
ob_size
)
-
1
==
self
->
ob_size
||
items
==
NULL
)
NRESIZE
(
items
,
PyObject
*
,
self
->
ob_size
+
1
);
if
(
items
==
NULL
)
{
PyErr_NoMemory
();
...
...
@@ -1878,7 +1881,8 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
saved_ob_size
=
self
->
ob_size
;
saved_ob_item
=
self
->
ob_item
;
self
->
ob_size
=
0
;
self
->
ob_item
=
empty_ob_item
=
PyMem_NEW
(
PyObject
*
,
0
);
/* self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0); */
self
->
ob_item
=
empty_ob_item
=
PyMem_NEW
(
PyObject
*
,
roundupsize
(
0
));
if
(
keyfunc
!=
NULL
)
{
for
(
i
=
0
;
i
<
saved_ob_size
;
i
++
)
{
...
...
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