summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-10-09 15:16:03 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-10-09 15:16:03 (GMT)
commitb29614e047110f4d9af993a6cdec4e3fb7ef9738 (patch)
treea15a5ac7b508c5033f640123f498a322f44b04ce /Tools
parenta5119351519926971240f61d0c23a5fc5d00743e (diff)
downloadcpython-b29614e047110f4d9af993a6cdec4e3fb7ef9738.zip
cpython-b29614e047110f4d9af993a6cdec4e3fb7ef9738.tar.gz
cpython-b29614e047110f4d9af993a6cdec4e3fb7ef9738.tar.bz2
compare singletons by identity not equality (closes #16712)
Patch from Serhiy Storchaka.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/gdb/libpython.py2
-rwxr-xr-xTools/scripts/texi2html.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 2cdc3da..368a7d5 100644
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -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
"""
def register (obj):
- if obj == None:
+ if obj is None:
obj = gdb
# Wire up the pretty-printer
diff --git a/Tools/scripts/texi2html.py b/Tools/scripts/texi2html.py
index af2147a..9983528 100755
--- a/Tools/scripts/texi2html.py
+++ b/Tools/scripts/texi2html.py
@@ -319,7 +319,7 @@ class TexinfoParser:
# Start saving text in a buffer instead of writing it to a file
def startsaving(self):
- if self.savetext != None:
+ if self.savetext is not None:
self.savestack.append(self.savetext)
# print '*** Recursively saving text, expect trouble'
self.savetext = ''
@@ -341,7 +341,7 @@ class TexinfoParser:
except:
print(args)
raise TypeError
- if self.savetext != None:
+ if self.savetext is not None:
self.savetext = self.savetext + text
elif self.nodefp:
self.nodefp.write(text)
@@ -350,7 +350,7 @@ class TexinfoParser:
# Complete the current node -- write footnotes and close file
def endnode(self):
- if self.savetext != None:
+ if self.savetext is not None:
print('*** Still saving text at end of node')
dummy = self.collectsavings()
if self.footnotes:
@@ -804,7 +804,7 @@ class TexinfoParser:
def close_i(self): self.write('</I>')
def open_footnote(self):
- # if self.savetext <> None:
+ # if self.savetext is not None:
# print '*** Recursive footnote -- expect weirdness'
id = len(self.footnotes) + 1
self.write(self.FN_SOURCE_PATTERN % {'id': repr(id)})
@@ -1442,7 +1442,7 @@ class TexinfoParser:
else:
# some other character, e.g. '-'
args = self.itemarg + ' ' + args
- if self.itemnumber != None:
+ if self.itemnumber is not None:
args = self.itemnumber + '. ' + args
self.itemnumber = increment(self.itemnumber)
if self.stack and self.stack[-1] == 'table':