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
b349c037
Commit
b349c037
authored
Oct 09, 2012
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compare singletons by identity not equality (closes #16712)
Patch from Serhiy Storchaka.
parent
34d31ade
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
15 deletions
+15
-15
Lib/os.py
Lib/os.py
+1
-1
Lib/pydoc.py
Lib/pydoc.py
+2
-2
Lib/test/support.py
Lib/test/support.py
+1
-1
Lib/test/test_ftplib.py
Lib/test/test_ftplib.py
+1
-1
Lib/test/test_posix.py
Lib/test/test_posix.py
+2
-2
Lib/test/test_sys.py
Lib/test/test_sys.py
+1
-1
Lib/unittest/case.py
Lib/unittest/case.py
+1
-1
Tools/gdb/libpython.py
Tools/gdb/libpython.py
+1
-1
Tools/scripts/texi2html.py
Tools/scripts/texi2html.py
+5
-5
No files found.
Lib/os.py
View file @
b349c037
...
@@ -985,7 +985,7 @@ def popen(cmd, mode="r", buffering=-1):
...
@@ -985,7 +985,7 @@ def popen(cmd, mode="r", buffering=-1):
raise
TypeError
(
"invalid cmd type (%s, expected string)"
%
type
(
cmd
))
raise
TypeError
(
"invalid cmd type (%s, expected string)"
%
type
(
cmd
))
if
mode
not
in
(
"r"
,
"w"
):
if
mode
not
in
(
"r"
,
"w"
):
raise
ValueError
(
"invalid mode %r"
%
mode
)
raise
ValueError
(
"invalid mode %r"
%
mode
)
if
buffering
==
0
or
buffering
==
None
:
if
buffering
==
0
or
buffering
is
None
:
raise
ValueError
(
"popen() does not support unbuffered streams"
)
raise
ValueError
(
"popen() does not support unbuffered streams"
)
import
subprocess
,
io
import
subprocess
,
io
if
mode
==
"r"
:
if
mode
==
"r"
:
...
...
Lib/pydoc.py
View file @
b349c037
...
@@ -2551,8 +2551,8 @@ def cli():
...
@@ -2551,8 +2551,8 @@ def cli():
if
opt
==
'-w'
:
if
opt
==
'-w'
:
writing
=
True
writing
=
True
if
start_server
==
True
:
if
start_server
:
if
port
==
None
:
if
port
is
None
:
port
=
0
port
=
0
browse
(
port
,
open_browser
=
open_browser
)
browse
(
port
,
open_browser
=
open_browser
)
return
return
...
...
Lib/test/support.py
View file @
b349c037
...
@@ -1232,7 +1232,7 @@ def run_with_tz(tz):
...
@@ -1232,7 +1232,7 @@ def run_with_tz(tz):
try
:
try
:
return
func
(
*
args
,
**
kwds
)
return
func
(
*
args
,
**
kwds
)
finally
:
finally
:
if
orig_tz
==
None
:
if
orig_tz
is
None
:
del
os
.
environ
[
'TZ'
]
del
os
.
environ
[
'TZ'
]
else
:
else
:
os
.
environ
[
'TZ'
]
=
orig_tz
os
.
environ
[
'TZ'
]
=
orig_tz
...
...
Lib/test/test_ftplib.py
View file @
b349c037
...
@@ -342,7 +342,7 @@ if ssl is not None:
...
@@ -342,7 +342,7 @@ if ssl is not None:
# http://www.mail-archive.com/openssl-users@openssl.org/msg60710.html
# http://www.mail-archive.com/openssl-users@openssl.org/msg60710.html
pass
pass
self
.
_ssl_closing
=
False
self
.
_ssl_closing
=
False
if
getattr
(
self
,
'_ccc'
,
False
)
==
False
:
if
getattr
(
self
,
'_ccc'
,
False
)
is
False
:
super
(
SSLConnection
,
self
).
close
()
super
(
SSLConnection
,
self
).
close
()
else
:
else
:
pass
pass
...
...
Lib/test/test_posix.py
View file @
b349c037
...
@@ -651,7 +651,7 @@ class PosixTester(unittest.TestCase):
...
@@ -651,7 +651,7 @@ class PosixTester(unittest.TestCase):
groups
=
idg
.
read
().
strip
()
groups
=
idg
.
read
().
strip
()
ret
=
idg
.
close
()
ret
=
idg
.
close
()
if
ret
!=
None
or
not
groups
:
if
ret
is
not
None
or
not
groups
:
raise
unittest
.
SkipTest
(
"need working 'id -G'"
)
raise
unittest
.
SkipTest
(
"need working 'id -G'"
)
self
.
assertEqual
(
self
.
assertEqual
(
...
@@ -665,7 +665,7 @@ class PosixTester(unittest.TestCase):
...
@@ -665,7 +665,7 @@ class PosixTester(unittest.TestCase):
groups
=
idg
.
read
().
strip
()
groups
=
idg
.
read
().
strip
()
ret
=
idg
.
close
()
ret
=
idg
.
close
()
if
ret
!=
None
or
not
groups
:
if
ret
is
not
None
or
not
groups
:
raise
unittest
.
SkipTest
(
"need working 'id -G'"
)
raise
unittest
.
SkipTest
(
"need working 'id -G'"
)
# 'id -G' and 'os.getgroups()' should return the same
# 'id -G' and 'os.getgroups()' should return the same
...
...
Lib/test/test_sys.py
View file @
b349c037
...
@@ -897,7 +897,7 @@ class SizeofTest(unittest.TestCase):
...
@@ -897,7 +897,7 @@ class SizeofTest(unittest.TestCase):
except
TypeError
:
except
TypeError
:
tb
=
sys
.
exc_info
()[
2
]
tb
=
sys
.
exc_info
()[
2
]
# traceback
# traceback
if
tb
!=
None
:
if
tb
is
not
None
:
check
(
tb
,
size
(
'2P2i'
))
check
(
tb
,
size
(
'2P2i'
))
# symtable entry
# symtable entry
# XXX
# XXX
...
...
Lib/unittest/case.py
View file @
b349c037
...
@@ -736,7 +736,7 @@ class TestCase(object):
...
@@ -736,7 +736,7 @@ class TestCase(object):
msg: Optional message to use on failure instead of a list of
msg: Optional message to use on failure instead of a list of
differences.
differences.
"""
"""
if
seq_type
!=
None
:
if
seq_type
is
not
None
:
seq_type_name
=
seq_type
.
__name__
seq_type_name
=
seq_type
.
__name__
if
not
isinstance
(
seq1
,
seq_type
):
if
not
isinstance
(
seq1
,
seq_type
):
raise
self
.
failureException
(
'First sequence is not a %s: %s'
raise
self
.
failureException
(
'First sequence is not a %s: %s'
...
...
Tools/gdb/libpython.py
View file @
b349c037
...
@@ -1332,7 +1332,7 @@ that this python file is installed to the same path as the library (or its
...
@@ -1332,7 +1332,7 @@ that this python file is installed to the same path as the library (or its
/usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
/usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
"""
"""
def
register
(
obj
):
def
register
(
obj
):
if
obj
==
None
:
if
obj
is
None
:
obj
=
gdb
obj
=
gdb
# Wire up the pretty-printer
# Wire up the pretty-printer
...
...
Tools/scripts/texi2html.py
View file @
b349c037
...
@@ -319,7 +319,7 @@ class TexinfoParser:
...
@@ -319,7 +319,7 @@ class TexinfoParser:
# Start saving text in a buffer instead of writing it to a file
# Start saving text in a buffer instead of writing it to a file
def
startsaving
(
self
):
def
startsaving
(
self
):
if
self
.
savetext
!=
None
:
if
self
.
savetext
is
not
None
:
self
.
savestack
.
append
(
self
.
savetext
)
self
.
savestack
.
append
(
self
.
savetext
)
# print '*** Recursively saving text, expect trouble'
# print '*** Recursively saving text, expect trouble'
self
.
savetext
=
''
self
.
savetext
=
''
...
@@ -341,7 +341,7 @@ class TexinfoParser:
...
@@ -341,7 +341,7 @@ class TexinfoParser:
except
:
except
:
print
(
args
)
print
(
args
)
raise
TypeError
raise
TypeError
if
self
.
savetext
!=
None
:
if
self
.
savetext
is
not
None
:
self
.
savetext
=
self
.
savetext
+
text
self
.
savetext
=
self
.
savetext
+
text
elif
self
.
nodefp
:
elif
self
.
nodefp
:
self
.
nodefp
.
write
(
text
)
self
.
nodefp
.
write
(
text
)
...
@@ -350,7 +350,7 @@ class TexinfoParser:
...
@@ -350,7 +350,7 @@ class TexinfoParser:
# Complete the current node -- write footnotes and close file
# Complete the current node -- write footnotes and close file
def
endnode
(
self
):
def
endnode
(
self
):
if
self
.
savetext
!=
None
:
if
self
.
savetext
is
not
None
:
print
(
'*** Still saving text at end of node'
)
print
(
'*** Still saving text at end of node'
)
dummy
=
self
.
collectsavings
()
dummy
=
self
.
collectsavings
()
if
self
.
footnotes
:
if
self
.
footnotes
:
...
@@ -804,7 +804,7 @@ class TexinfoParser:
...
@@ -804,7 +804,7 @@ class TexinfoParser:
def
close_i
(
self
):
self
.
write
(
'</I>'
)
def
close_i
(
self
):
self
.
write
(
'</I>'
)
def
open_footnote
(
self
):
def
open_footnote
(
self
):
# if self.savetext
<>
None:
# if self.savetext
is not
None:
# print '*** Recursive footnote -- expect weirdness'
# print '*** Recursive footnote -- expect weirdness'
id
=
len
(
self
.
footnotes
)
+
1
id
=
len
(
self
.
footnotes
)
+
1
self
.
write
(
self
.
FN_SOURCE_PATTERN
%
{
'id'
:
repr
(
id
)})
self
.
write
(
self
.
FN_SOURCE_PATTERN
%
{
'id'
:
repr
(
id
)})
...
@@ -1442,7 +1442,7 @@ class TexinfoParser:
...
@@ -1442,7 +1442,7 @@ class TexinfoParser:
else
:
else
:
# some other character, e.g. '-'
# some other character, e.g. '-'
args
=
self
.
itemarg
+
' '
+
args
args
=
self
.
itemarg
+
' '
+
args
if
self
.
itemnumber
!=
None
:
if
self
.
itemnumber
is
not
None
:
args
=
self
.
itemnumber
+
'. '
+
args
args
=
self
.
itemnumber
+
'. '
+
args
self
.
itemnumber
=
increment
(
self
.
itemnumber
)
self
.
itemnumber
=
increment
(
self
.
itemnumber
)
if
self
.
stack
and
self
.
stack
[
-
1
]
==
'table'
:
if
self
.
stack
and
self
.
stack
[
-
1
]
==
'table'
:
...
...
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