diff -r d7d3e1a03fe0 Lib/os.py --- a/Lib/os.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Lib/os.py Tue Oct 09 12:42:22 2012 +0300 @@ -961,7 +961,7 @@ raise TypeError("invalid cmd type (%s, expected string)" % type(cmd)) if mode not in ("r", "w"): 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") import subprocess, io if mode == "r": diff -r d7d3e1a03fe0 Lib/pydoc.py --- a/Lib/pydoc.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Lib/pydoc.py Tue Oct 09 12:42:22 2012 +0300 @@ -2551,8 +2551,8 @@ if opt == '-w': writing = True - if start_server == True: - if port == None: + if start_server: + if port is None: port = 0 browse(port, open_browser=open_browser) return diff -r d7d3e1a03fe0 Lib/test/support.py --- a/Lib/test/support.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Lib/test/support.py Tue Oct 09 12:42:22 2012 +0300 @@ -1232,7 +1232,7 @@ try: return func(*args, **kwds) finally: - if orig_tz == None: + if orig_tz is None: del os.environ['TZ'] else: os.environ['TZ'] = orig_tz diff -r d7d3e1a03fe0 Lib/test/test_ftplib.py --- a/Lib/test/test_ftplib.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Lib/test/test_ftplib.py Tue Oct 09 12:42:22 2012 +0300 @@ -342,7 +342,7 @@ # http://www.mail-archive.com/openssl-users@openssl.org/msg60710.html pass self._ssl_closing = False - if getattr(self, '_ccc', False) == False: + if getattr(self, '_ccc', False) is False: super(SSLConnection, self).close() else: pass diff -r d7d3e1a03fe0 Lib/test/test_posix.py --- a/Lib/test/test_posix.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Lib/test/test_posix.py Tue Oct 09 12:42:22 2012 +0300 @@ -651,7 +651,7 @@ groups = idg.read().strip() ret = idg.close() - if ret != None or not groups: + if ret is not None or not groups: raise unittest.SkipTest("need working 'id -G'") self.assertEqual( @@ -665,7 +665,7 @@ groups = idg.read().strip() ret = idg.close() - if ret != None or not groups: + if ret is not None or not groups: raise unittest.SkipTest("need working 'id -G'") # 'id -G' and 'os.getgroups()' should return the same diff -r d7d3e1a03fe0 Lib/test/test_sys.py --- a/Lib/test/test_sys.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Lib/test/test_sys.py Tue Oct 09 12:42:22 2012 +0300 @@ -897,7 +897,7 @@ except TypeError: tb = sys.exc_info()[2] # traceback - if tb != None: + if tb is not None: check(tb, size('2P2i')) # symtable entry # XXX diff -r d7d3e1a03fe0 Lib/unittest/case.py --- a/Lib/unittest/case.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Lib/unittest/case.py Tue Oct 09 12:42:22 2012 +0300 @@ -736,7 +736,7 @@ msg: Optional message to use on failure instead of a list of differences. """ - if seq_type != None: + if seq_type is not None: seq_type_name = seq_type.__name__ if not isinstance(seq1, seq_type): raise self.failureException('First sequence is not a %s: %s' diff -r d7d3e1a03fe0 Tools/gdb/libpython.py --- a/Tools/gdb/libpython.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Tools/gdb/libpython.py Tue Oct 09 12:42:22 2012 +0300 @@ -1332,7 +1332,7 @@ /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 -r d7d3e1a03fe0 Tools/scripts/texi2html.py --- a/Tools/scripts/texi2html.py Tue Oct 09 08:23:06 2012 +0100 +++ b/Tools/scripts/texi2html.py Tue Oct 09 12:42:22 2012 +0300 @@ -319,7 +319,7 @@ # 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 @@ 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 @@ # 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 @@ def close_i(self): self.write('') 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 @@ 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':