]> granicus.if.org Git - python/commitdiff
#2503 make singletons compared with "is" not == or !=
authorBenjamin Peterson <benjamin@python.org>
Sat, 29 Mar 2008 15:24:25 +0000 (15:24 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 29 Mar 2008 15:24:25 +0000 (15:24 +0000)
Thanks to Wummel for the patch

54 files changed:
Demo/classes/Dbm.py
Demo/curses/ncurses.py
Demo/rpc/mountclient.py
Demo/rpc/nfsclient.py
Demo/rpc/rpc.py
Demo/tkinter/guido/paint.py
Lib/bsddb/dbshelve.py
Lib/bsddb/test/test_basics.py
Lib/bsddb/test/test_dbtables.py
Lib/idlelib/AutoComplete.py
Lib/idlelib/PyShell.py
Lib/lib-tk/Tkinter.py
Lib/lib-tk/turtle.py
Lib/plat-mac/EasyDialogs.py
Lib/plat-mac/FrameWork.py
Lib/plat-mac/MiniAEFrame.py
Lib/plat-mac/PixMapWrapper.py
Lib/plat-mac/aepack.py
Lib/plat-mac/buildtools.py
Lib/plat-mac/findertools.py
Lib/plat-mac/gensuitemodule.py
Lib/plat-mac/ic.py
Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py
Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py
Lib/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py
Lib/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py
Lib/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py
Lib/plat-mac/lib-scriptpackages/Finder/Finder_Basics.py
Lib/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py
Lib/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py
Lib/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py
Lib/plat-mac/lib-scriptpackages/Netscape/PowerPlant.py
Lib/plat-mac/lib-scriptpackages/Netscape/Required_suite.py
Lib/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py
Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py
Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py
Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py
Lib/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py
Lib/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py
Lib/plat-mac/macostools.py
Lib/plat-mac/videoreader.py
Lib/plat-os2emx/grp.py
Lib/plat-os2emx/pwd.py
Lib/test/test_ast.py
Lib/test/test_mailbox.py
Lib/test/test_pyclbr.py
Lib/test/test_ssl.py
Lib/xml/sax/expatreader.py
Mac/BuildScript/build-installer.py
Mac/Demo/applescript/Disk_Copy/Utility_Events.py
Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py
Mac/Tools/Doc/setup.py
Mac/scripts/buildpkg.py
Tools/bgen/bgen/bgenGenerator.py

index 482806a4ee05a65d9201a1a4e8bcd3b10d1f9b18..892c103e0cf607451099f09754b65c2a17924e5e 100755 (executable)
@@ -50,7 +50,7 @@ def test():
                 value = d[key]
                 print 'currently:', value
             value = input('value: ')
-            if value == None:
+            if value is None:
                 del d[key]
             else:
                 d[key] = value
index c9394d0e51aae6df1f5989376958eee2039bd35b..8af3b4201513134248566215900002c012b20273 100644 (file)
@@ -9,7 +9,7 @@ import curses
 from curses import panel
 
 def wGetchar(win = None):
-    if win == None: win = stdscr
+    if win is None: win = stdscr
     return win.getch()
 
 def Getchar():
index 318a9d99bb50cd4c53bd4211078543edfd3835f7..4e8d92a09c837e6afbc064c1122166bce98616f7 100644 (file)
@@ -100,7 +100,7 @@ class PartialMountClient:
     # This function is called to cough up a suitable
     # authentication object for a call to procedure 'proc'.
     def mkcred(self):
-        if self.cred == None:
+        if self.cred is None:
             self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default()
         return self.cred
 
index c4387b4a02be414ab955ed5f06a87ce222214570..09e78dda8f938102b9bbb9c61c8410ae4046faa4 100644 (file)
@@ -129,7 +129,7 @@ class NFSClient(UDPClient):
         self.unpacker = NFSUnpacker('')
 
     def mkcred(self):
-        if self.cred == None:
+        if self.cred is None:
             self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default()
         return self.cred
 
@@ -170,7 +170,7 @@ class NFSClient(UDPClient):
             for fileid, name, cookie in entries:
                 list.append((fileid, name))
                 last_cookie = cookie
-            if eof or last_cookie == None:
+            if eof or last_cookie is None:
                 break
             ra = (ra[0], last_cookie, ra[2])
         return list
@@ -184,7 +184,7 @@ def test():
     else: filesys = None
     from mountclient import UDPMountClient, TCPMountClient
     mcl = TCPMountClient(host)
-    if filesys == None:
+    if filesys is None:
         list = mcl.Export()
         for item in list:
             print item
index 141fe09a5c0937fe670ae8565322e484c071c949..0a14bf21308ec3cffb59855eeddb2e682dfdf3b5 100644 (file)
@@ -264,13 +264,13 @@ class Client:
 
     def mkcred(self):
         # Override this to use more powerful credentials
-        if self.cred == None:
+        if self.cred is None:
             self.cred = (AUTH_NULL, make_auth_null())
         return self.cred
 
     def mkverf(self):
         # Override this to use a more powerful verifier
-        if self.verf == None:
+        if self.verf is None:
             self.verf = (AUTH_NULL, make_auth_null())
         return self.verf
 
@@ -321,7 +321,7 @@ last_resv_port_tried = None
 def bindresvport(sock, host):
     global last_resv_port_tried
     FIRST, LAST = 600, 1024 # Range of ports to try
-    if last_resv_port_tried == None:
+    if last_resv_port_tried is None:
         import os
         last_resv_port_tried = FIRST + os.getpid() % (LAST-FIRST)
     for i in range(last_resv_port_tried, LAST) + \
@@ -814,7 +814,7 @@ class UDPServer(Server):
     def session(self):
         call, host_port = self.sock.recvfrom(8192)
         reply = self.handle(call)
-        if reply != None:
+        if reply is not None:
             self.sock.sendto(reply, host_port)
 
 
index d46e20b9ade412c971e2d60205bae7fc2241b0cf..7b2e814c6571084d3a47f87e87d189c037fcdebb 100644 (file)
@@ -50,7 +50,7 @@ def b1up(event):
 def motion(event):
     if b1 == "down":
         global xold, yold
-        if xold != None and yold != None:
+        if xold is not None and yold is not None:
             event.widget.create_line(xold,yold,event.x,event.y,smooth=TRUE)
                           # here's where you draw it. smooth. neat.
         xold = event.x
index f5f8b9a5cb894dac813283579b7c44ef04eba2c1..96f604a68a90537f4d22de52b5336068cda3955a 100644 (file)
@@ -133,7 +133,7 @@ class DBShelf(DictMixin):
 
 
     def keys(self, txn=None):
-        if txn != None:
+        if txn is not None:
             return self.db.keys(txn)
         else:
             return self.db.keys()
@@ -157,7 +157,7 @@ class DBShelf(DictMixin):
 
 
     def items(self, txn=None):
-        if txn != None:
+        if txn is not None:
             items = self.db.items(txn)
         else:
             items = self.db.items()
@@ -168,7 +168,7 @@ class DBShelf(DictMixin):
         return newitems
 
     def values(self, txn=None):
-        if txn != None:
+        if txn is not None:
             values = self.db.values(txn)
         else:
             values = self.db.values()
index de935f755667dc6f1f684e956b80d4aa75433c59..9b38d575de1760f7b1488bdb43a4bd63c48084a4 100644 (file)
@@ -363,7 +363,7 @@ class BasicTestCase(unittest.TestCase):
         else:
             if set_raises_error:
                 self.fail("expected exception")
-            if n != None:
+            if n is not None:
                 self.fail("expected None: %r" % (n,))
 
         rec = c.get_both('0404', self.makeData('0404'))
@@ -377,7 +377,7 @@ class BasicTestCase(unittest.TestCase):
         else:
             if get_raises_error:
                 self.fail("expected exception")
-            if n != None:
+            if n is not None:
                 self.fail("expected None: %r" % (n,))
 
         if self.d.get_type() == db.DB_BTREE:
index 46602cecd3f151843783c5c5a5e182261c6cd3e2..faddd1100c2e71f469d1dc63e7cf2a79638e9561 100644 (file)
@@ -323,7 +323,7 @@ class TableDBTestCase(unittest.TestCase):
         self.tdb.Insert(tabname, {'Type': 'Unknown', 'Access': '0'})
 
         def set_type(type):
-            if type == None:
+            if type is None:
                 return 'MP3'
             return type
 
index e1549be8387d910154eb9eacaab4a3393f558db0..bed2b8c4cd09c7b54162f62793b58d7a12155c4f 100644 (file)
@@ -35,10 +35,9 @@ class AutoComplete:
                                    "popupwait", type="int", default=0)
 
     def __init__(self, editwin=None):
-        if editwin == None:  # subprocess and test
-            self.editwin = None
-            return
         self.editwin = editwin
+        if editwin is None:  # subprocess and test
+            return
         self.text = editwin.text
         self.autocompletewindow = None
 
index f1148e2e5d022dc8ec0b1b92f8db8a5a93bfb38e..f991ae9fde06a82e7299bb08f099311e940acb95 100644 (file)
@@ -932,7 +932,7 @@ class PyShell(OutputWindow):
                 "The program is still running!\n Do you want to kill it?",
                 default="ok",
                 parent=self.text)
-            if response == False:
+            if response is False:
                 return "cancel"
         if self.reading:
             self.top.quit()
index 3ec3407a4bcefbe514628dca2525bbaee22c3836..af77544c5d62836a1245cbd1be64a8e7e7523474 100644 (file)
@@ -188,7 +188,7 @@ class Variable:
         else:
             self._name = 'PY_VAR' + repr(_varnum)
             _varnum += 1
-        if value != None:
+        if value is not None:
             self.set(value)
         elif not self._tk.call("info", "exists", self._name):
             self.set(self._default)
index fcde9af4ed4e6eb92c571b9707b269997f7be069..e4cac294dfefe84306b7b6900787f4d4cdc88d01 100644 (file)
@@ -749,25 +749,25 @@ def setup(**geometry):
     global _width, _height, _startx, _starty
 
     width = geometry.get('width',_width)
-    if width >= 0 or width == None:
+    if width >= 0 or width is None:
         _width = width
     else:
         raise ValueError, "width can not be less than 0"
 
     height = geometry.get('height',_height)
-    if height >= 0 or height == None:
+    if height >= 0 or height is None:
         _height = height
     else:
         raise ValueError, "height can not be less than 0"
 
     startx = geometry.get('startx', _startx)
-    if startx >= 0 or startx == None:
+    if startx >= 0 or startx is None:
         _startx = _startx
     else:
         raise ValueError, "startx can not be less than 0"
 
     starty = geometry.get('starty', _starty)
-    if starty >= 0 or starty == None:
+    if starty >= 0 or starty is None:
         _starty = starty
     else:
         raise ValueError, "startx can not be less than 0"
index b33d1be5488cf57a5e553ac3741bbc1f6e1aad44..3cafbb7bf0c100da49e236040bf38c89b2f2a551 100644 (file)
@@ -79,7 +79,7 @@ def Message(msg, id=260, ok=None):
         return
     h = d.GetDialogItemAsControl(2)
     SetDialogItemText(h, lf2cr(msg))
-    if ok != None:
+    if ok is not None:
         h = d.GetDialogItemAsControl(1)
         h.SetControlTitle(ok)
     d.SetDialogDefaultItem(1)
@@ -116,10 +116,10 @@ def AskString(prompt, default = "", id=261, ok=None, cancel=None):
     SetDialogItemText(h, lf2cr(default))
     d.SelectDialogItemText(4, 0, 999)
 #       d.SetDialogItem(4, 0, 255)
-    if ok != None:
+    if ok is not None:
         h = d.GetDialogItemAsControl(1)
         h.SetControlTitle(ok)
-    if cancel != None:
+    if cancel is not None:
         h = d.GetDialogItemAsControl(2)
         h.SetControlTitle(cancel)
     d.SetDialogDefaultItem(1)
@@ -160,10 +160,10 @@ def AskPassword(prompt,  default='', id=264, ok=None, cancel=None):
     SetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag, default)
     d.SelectDialogItemText(4, 0, 999)
     Ctl.SetKeyboardFocus(d.GetDialogWindow(), pwd, kControlEditTextPart)
-    if ok != None:
+    if ok is not None:
         h = d.GetDialogItemAsControl(1)
         h.SetControlTitle(ok)
-    if cancel != None:
+    if cancel is not None:
         h = d.GetDialogItemAsControl(2)
         h.SetControlTitle(cancel)
     d.SetDialogDefaultItem(Dialogs.ok)
@@ -204,19 +204,19 @@ def AskYesNoCancel(question, default = 0, yes=None, no=None, cancel=None, id=262
     # The question string is item 5
     h = d.GetDialogItemAsControl(5)
     SetDialogItemText(h, lf2cr(question))
-    if yes != None:
+    if yes is not None:
         if yes == '':
             d.HideDialogItem(2)
         else:
             h = d.GetDialogItemAsControl(2)
             h.SetControlTitle(yes)
-    if no != None:
+    if no is not None:
         if no == '':
             d.HideDialogItem(3)
         else:
             h = d.GetDialogItemAsControl(3)
             h.SetControlTitle(no)
-    if cancel != None:
+    if cancel is not None:
         if cancel == '':
             d.HideDialogItem(4)
         else:
@@ -317,7 +317,7 @@ class ProgressBar:
 
     def set(self, value, max=None):
         """set(value) - Set progress bar position"""
-        if max != None:
+        if max is not None:
             self.maxval = max
             bar = self.d.GetDialogItemAsControl(3)
             if max <= 0:    # indeterminate bar
index 0a8c1b8e6eea5569caec9a04eeb6a57274049ecd..4437cf871af1475a196a015fc000a4dfb7aa044c 100644 (file)
@@ -92,7 +92,7 @@ _watch = None
 def setwatchcursor():
     global _watch
 
-    if _watch == None:
+    if _watch is None:
         _watch = GetCursor(4).data
     SetCursor(_watch)
 
@@ -129,7 +129,7 @@ class Application:
         self._quititem = MenuItem(m, "Quit", "Q", self._quit)
 
     def gethelpmenu(self):
-        if self._helpmenu == None:
+        if self._helpmenu is None:
             self._helpmenu = HelpMenu(self.menubar)
         return self._helpmenu
 
@@ -266,7 +266,7 @@ class Application:
         else:
             name = "do_%d" % partcode
 
-        if wid == None:
+        if wid is None:
             # No window, or a non-python window
             try:
                 handler = getattr(self, name)
@@ -475,7 +475,7 @@ class MenuBar:
         self.menus = None
 
     def addmenu(self, title, after = 0, id=None):
-        if id == None:
+        if id is None:
             id = self.getnextid()
         if DEBUG: print 'Newmenu', title, id # XXXX
         m = NewMenu(id, title)
@@ -907,8 +907,8 @@ class ScrolledWindow(ControlsWindow):
         self.barx_enabled = self.bary_enabled = 1
         x0, y0, x1, y1 = self.wid.GetWindowPort().GetPortBounds()
         vx, vy = self.getscrollbarvalues()
-        if vx == None: self.barx_enabled, vx = 0, 0
-        if vy == None: self.bary_enabled, vy = 0, 0
+        if vx is None: self.barx_enabled, vx = 0, 0
+        if vy is None: self.bary_enabled, vy = 0, 0
         if wantx:
             rect = x0-1, y1-(SCROLLBARWIDTH-1), x1-(SCROLLBARWIDTH-2), y1+1
             self.barx = NewControl(self.wid, rect, "", 1, vx, 0, 32767, 16, 0)
@@ -1007,7 +1007,7 @@ class ScrolledWindow(ControlsWindow):
         SetPort(self.wid)
         vx, vy = self.getscrollbarvalues()
         if self.barx:
-            if vx == None:
+            if vx is None:
                 self.barx.HiliteControl(255)
                 self.barx_enabled = 0
             else:
@@ -1017,7 +1017,7 @@ class ScrolledWindow(ControlsWindow):
                         self.barx.HiliteControl(0)
                 self.barx.SetControlValue(vx)
         if self.bary:
-            if vy == None:
+            if vy is None:
                 self.bary.HiliteControl(255)
                 self.bary_enabled = 0
             else:
index 6a08dc942d96c54329ec641a7a53c2e7649d3252..506c5cb1a8a43f6d8d9a4733c35955fdbab403ae 100644 (file)
@@ -158,7 +158,7 @@ class AEServer:
             #Same try/except comment as above
             rv = _function(**_parameters)
 
-        if rv == None:
+        if rv is None:
             aetools.packevent(_reply, {})
         else:
             aetools.packevent(_reply, {'----':rv})
index 7edbac26c8df78a92beb68856a78ac89b9cec182..62297b34c714db5b82e22676dff3259936668bb8 100644 (file)
@@ -146,9 +146,9 @@ class PixMapWrapper:
         """Draw this pixmap into the given (default current) grafport."""
         src = self.bounds
         dest = [x1,y1,x2,y2]
-        if x2 == None:
+        if x2 is None:
             dest[2] = x1 + src[2]-src[0]
-        if y2 == None:
+        if y2 is None:
             dest[3] = y1 + src[3]-src[1]
         if not port: port = Qd.GetPort()
         Qd.CopyBits(self.PixMap(), port.GetPortBitMapForCopyBits(), src, tuple(dest),
index 9ad9c4401ec68de2a7bb83b9033683980092d260..d69534f4a21175a9553e8cef36d5bc7ea2a86c40 100644 (file)
@@ -77,7 +77,7 @@ def pack(x, forcetype = None):
         else:
             return pack(x).AECoerceDesc(forcetype)
 
-    if x == None:
+    if x is None:
         return AE.AECreateDesc('null', '')
 
     if isinstance(x, AEDescType):
index f5dab88d9d2bad22aa84a0ac50fb4d046f396110..7462d9556c271fe83392542adbac385d96d5d137 100644 (file)
@@ -203,13 +203,13 @@ def process_common(template, progress, code, rsrcname, destname, is_update,
     dummy, tmplowner = copyres(input, output, skiptypes, 1, progress)
 
     Res.CloseResFile(input)
-##  if ownertype == None:
+##  if ownertype is None:
 ##      raise BuildError, "No owner resource found in either resource file or template"
     # Make sure we're manipulating the output resource file now
 
     Res.UseResFile(output)
 
-    if ownertype == None:
+    if ownertype is None:
         # No owner resource in the template. We have skipped the
         # Python owner resource, so we have to add our own. The relevant
         # bundle stuff is already included in the interpret/applet template.
index 54b1bdec02b3fa11189b9c63512b28d9ad77bc1b..34dde9a9cf799d78e7be2b2b3da49017b9aaa8b2 100644 (file)
@@ -125,7 +125,7 @@ def comment(object, comment=None):
     """comment: get or set the Finder-comment of the item, displayed in the 'Get Info' window."""
     object = Carbon.File.FSRef(object)
     object_alias = object.FSNewAliasMonimal()
-    if comment == None:
+    if comment is None:
         return _getcomment(object_alias)
     else:
         return _setcomment(object_alias, comment)
@@ -329,7 +329,7 @@ def label(object, index=None):
     """label: set or get the label of the item. Specify file by name or fsspec."""
     object = Carbon.File.FSRef(object)
     object_alias = object.FSNewAliasMinimal()
-    if index == None:
+    if index is None:
         return _getlabel(object_alias)
     if index < 0 or index > 7:
         index = 0
@@ -375,7 +375,7 @@ def windowview(folder, view=None):
     """
     fsr = Carbon.File.FSRef(folder)
     folder_alias = fsr.FSNewAliasMinimal()
-    if view == None:
+    if view is None:
         return _getwindowview(folder_alias)
     return _setwindowview(folder_alias, view)
 
@@ -533,7 +533,7 @@ def icon(object, icondata=None):
     Development opportunity: get and set the data as PICT."""
     fsr = Carbon.File.FSRef(object)
     object_alias = fsr.FSNewAliasMinimal()
-    if icondata == None:
+    if icondata is None:
         return _geticon(object_alias)
     return _seticon(object_alias, icondata)
 
index 87132c57fc793098347343e1a89ade5f853f9e7f..033bf9e69b96bf204172925de2a5031f47d253e5 100644 (file)
@@ -770,7 +770,7 @@ class SuiteCompiler:
             fp.write("        if _object:\n")
             fp.write("            _arguments['----'] = _object\n")
         else:
-            fp.write("        if _no_object != None: raise TypeError, 'No direct arg expected'\n")
+            fp.write("        if _no_object is not None: raise TypeError, 'No direct arg expected'\n")
         fp.write("\n")
         #
         # Do enum-name substitution
index 6575336af1a8094a9fcc4515ebde1c9ed956f233..46788c926273df3a0d5e019efb3a6a9aa84020af 100644 (file)
@@ -202,12 +202,12 @@ class IC:
         self.ic.ICLaunchURL(hint, url, 0, len(url))
 
     def parseurl(self, data, start=None, end=None, hint=""):
-        if start == None:
+        if start is None:
             selStart = 0
             selEnd = len(data)
         else:
             selStart = selEnd = start
-        if end != None:
+        if end is not None:
             selEnd = end
         selStart, selEnd = self.ic.ICParseURL(hint, data, selStart, selEnd, self.h)
         return self.h.data, selStart, selEnd
@@ -231,27 +231,27 @@ _dft_ic = None
 
 def launchurl(url, hint=""):
     global _dft_ic
-    if _dft_ic == None: _dft_ic = IC()
+    if _dft_ic is None: _dft_ic = IC()
     return _dft_ic.launchurl(url, hint)
 
 def parseurl(data, start=None, end=None, hint=""):
     global _dft_ic
-    if _dft_ic == None: _dft_ic = IC()
+    if _dft_ic is None: _dft_ic = IC()
     return _dft_ic.parseurl(data, start, end, hint)
 
 def mapfile(filename):
     global _dft_ic
-    if _dft_ic == None: _dft_ic = IC()
+    if _dft_ic is None: _dft_ic = IC()
     return _dft_ic.mapfile(filename)
 
 def maptypecreator(type, creator, filename=""):
     global _dft_ic
-    if _dft_ic == None: _dft_ic = IC()
+    if _dft_ic is None: _dft_ic = IC()
     return _dft_ic.maptypecreator(type, creator, filename)
 
 def settypecreator(file):
     global _dft_ic
-    if _dft_ic == None: _dft_ic = IC()
+    if _dft_ic is None: _dft_ic = IC()
     return _dft_ic.settypecreator(file)
 
 def _test():
index 0fd562b95dc0e675e72dd6c06b91d030a0efddaa..84b8561d65f2059f19bdd15c55e8a129b56ebb4e 100644 (file)
@@ -51,7 +51,7 @@ class CodeWarrior_suite_Events:
         _subcode = 'MAKE'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -135,7 +135,7 @@ class CodeWarrior_suite_Events:
         _subcode = 'EXPT'
 
         aetools.keysubst(_arguments, self._argmap_export)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -154,7 +154,7 @@ class CodeWarrior_suite_Events:
         _subcode = 'RMOB'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -193,7 +193,7 @@ class CodeWarrior_suite_Events:
         _subcode = 'RUN '
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -232,7 +232,7 @@ class CodeWarrior_suite_Events:
         _subcode = 'UP2D'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 909cdc0fea95ccbba416a69cc440f5b8998d2fd2..ca1f6943f38e85f5ae62507dd0b02457d0ce271d 100644 (file)
@@ -72,7 +72,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'ClsP'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -190,7 +190,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'GDoc'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -217,7 +217,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'Gref'
 
         aetools.keysubst(_arguments, self._argmap_Get_Preferences)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -263,7 +263,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'GetP'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -283,7 +283,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'GSeg'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -324,7 +324,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'NsCl'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -410,7 +410,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'Make'
 
         aetools.keysubst(_arguments, self._argmap_Make_Project)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -503,7 +503,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'RemB'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -543,7 +543,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'ReFP'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -570,7 +570,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'RunP'
 
         aetools.keysubst(_arguments, self._argmap_Run_Project)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -682,7 +682,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'Pref'
 
         aetools.keysubst(_arguments, self._argmap_Set_Preferences)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -778,7 +778,7 @@ class Metrowerks_Shell_Suite_Events:
         _subcode = 'UpdP'
 
         aetools.keysubst(_arguments, self._argmap_Update_Project)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index ae277a27608c075ed42b233fcab1a430881aae17..25324f8816317659d3abd04055a055cee0d4cb97 100644 (file)
@@ -115,7 +115,7 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _subcode = 'crel'
 
         aetools.keysubst(_arguments, self._argmap_make)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 0a985d123bba45f3dd16f8113174eb651226ea8d..9e2541e5a4d103bdc2e484067572cc47c437ec52 100644 (file)
@@ -61,7 +61,7 @@ class Required_Suite_Events(Required_Suite_Events):
         _subcode = 'quit'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -80,7 +80,7 @@ class Required_Suite_Events(Required_Suite_Events):
         _subcode = 'oapp'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index ff808eb9682266ec3580eed6a51c6d75a549b4c7..e87526f54805314fba85a6fb531f7014e63b595e 100644 (file)
@@ -42,7 +42,7 @@ class Web_Browser_Suite_Events:
         _subcode = 'CLSA'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -69,7 +69,7 @@ class Web_Browser_Suite_Events:
         _subcode = 'CLOS'
 
         aetools.keysubst(_arguments, self._argmap_CloseWindow)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -110,7 +110,7 @@ class Web_Browser_Suite_Events:
         _subcode = 'LSTW'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index c0a7b20050b87d4bbb24b37948a906075706a302..4e3928c37992d762d637c63866b1aa592c43e18c 100644 (file)
@@ -20,7 +20,7 @@ class Finder_Basics_Events:
         _subcode = 'copy'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 69da626682767df2519902d3dfc4cd16b1af41ad..b17fdf471e148e854ea1b7a4d48862410fea7f87 100644 (file)
@@ -20,7 +20,7 @@ class Legacy_suite_Events:
         _subcode = 'rest'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -39,7 +39,7 @@ class Legacy_suite_Events:
         _subcode = 'shut'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -58,7 +58,7 @@ class Legacy_suite_Events:
         _subcode = 'slep'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 830f58c83592e6907932c3b80837bcbdebecd143..b97918f99667c566a3b69423fbe019b6e02c0d88 100644 (file)
@@ -179,7 +179,7 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _subcode = 'crel'
 
         aetools.keysubst(_arguments, self._argmap_make)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -285,7 +285,7 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _subcode = 'quit'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index f4aea730c6d79f1947989689eb0e8cec5691bcfe..9d2625f5ca90a0d20a32e19415d704615afa170c 100644 (file)
@@ -21,7 +21,7 @@ class Mozilla_suite_Events:
         _subcode = 'Impt'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -41,7 +41,7 @@ class Mozilla_suite_Events:
         _subcode = 'upro'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -61,7 +61,7 @@ class Mozilla_suite_Events:
         _subcode = 'wurl'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -126,7 +126,7 @@ class Mozilla_suite_Events:
         _subcode = 'addr'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -165,7 +165,7 @@ class Mozilla_suite_Events:
         _subcode = 'prfl'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 7767305cb33a3beca801b090b8564dfb8751709f..d37e66fc807f9f9f2a889b5bc499923f5669bc24 100644 (file)
@@ -25,7 +25,7 @@ class PowerPlant_Events:
         _subcode = 'sttg'
 
         aetools.keysubst(_arguments, self._argmap_SwitchTellTarget)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index b5c411048cc633f6c2245406fec9a70ed4f4387a..c99794f5a8f788142432104692938b96f8dd05da 100644 (file)
@@ -61,7 +61,7 @@ class Required_suite_Events(Required_Suite_Events):
         _subcode = 'quit'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -80,7 +80,7 @@ class Required_suite_Events(Required_Suite_Events):
         _subcode = 'oapp'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 06cbfa7acd0f0bc1724e90569864480342765342..1706b25c2327cf2635f2fa633a8bcce1c10806e0 100644 (file)
@@ -154,7 +154,7 @@ class WorldWideWeb_suite_Events:
         _subcode = 'LSTW'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 773d1d7563806474d6d17760e3a0ded681b0e91c..ff5bcc4318d0c8cfa07d60036a287e35aef88b6a 100644 (file)
@@ -268,7 +268,7 @@ class AppleScript_Suite_Events:
         _subcode = 'actv'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -371,7 +371,7 @@ class AppleScript_Suite_Events:
         _subcode = 'tend'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -443,7 +443,7 @@ class AppleScript_Suite_Events:
         _subcode = 'idle'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -462,7 +462,7 @@ class AppleScript_Suite_Events:
         _subcode = 'noop'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -585,7 +585,7 @@ class AppleScript_Suite_Events:
         _subcode = 'log1'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -625,7 +625,7 @@ class AppleScript_Suite_Events:
         _subcode = 'log0'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -644,7 +644,7 @@ class AppleScript_Suite_Events:
         _subcode = 'tell'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 86681f57bb691699c61a4689b99c2174c98e68fa..10e5423771d2349cf85107acf0a3d90e478b6fe2 100644 (file)
@@ -255,7 +255,7 @@ class Standard_Suite_Events(builtin_Suite_Events):
         _subcode = 'crel'
 
         aetools.keysubst(_arguments, self._argmap_make)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -345,7 +345,7 @@ class Standard_Suite_Events(builtin_Suite_Events):
         _subcode = 'quit'
 
         aetools.keysubst(_arguments, self._argmap_quit)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
         aetools.enumsubst(_arguments, 'savo', _Enum_savo)
 
@@ -365,7 +365,7 @@ class Standard_Suite_Events(builtin_Suite_Events):
         _subcode = 'rapp'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -384,7 +384,7 @@ class Standard_Suite_Events(builtin_Suite_Events):
         _subcode = 'oapp'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index f20ef8434f889272792ad5768d74b2af02a3125c..0ec16c080039f13211d6f335e600072e78838779 100644 (file)
@@ -175,7 +175,7 @@ class Standard_Suite_Events:
         _subcode = 'crel'
 
         aetools.keysubst(_arguments, self._argmap_make)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 035290f32b7133b230e8bf611fd4df364d24eecc..e42528ca7424e761ca0e9e3aaa147b9549cc65bd 100644 (file)
@@ -175,7 +175,7 @@ class Standard_Suite_Events:
         _subcode = 'crel'
 
         aetools.keysubst(_arguments, self._argmap_make)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index 318250fa27de45088c5669adf98594084e0f9489..e3ee2715c6448ad54a4d58186c8a021bd23e9f25 100644 (file)
@@ -37,7 +37,7 @@ class builtin_Suite_Events:
         _subcode = 'oapp'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -56,7 +56,7 @@ class builtin_Suite_Events:
         _subcode = 'rapp'
 
         if _arguments: raise TypeError, 'No optional args expected'
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
@@ -100,7 +100,7 @@ class builtin_Suite_Events:
         _subcode = 'quit'
 
         aetools.keysubst(_arguments, self._argmap_quit)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
         aetools.enumsubst(_arguments, 'savo', _Enum_savo)
 
index 217f9e8739fc04bb499a5e1e15630bac83a9b812..67bb4971825df46b86e5e1e32357d4e7ba6562ac 100644 (file)
@@ -106,7 +106,7 @@ def copy(src, dst, createpath=0, copydates=1, forcetype=None):
     sf = srcfss.FSpGetFInfo()
     df = dstfss.FSpGetFInfo()
     df.Creator, df.Type = sf.Creator, sf.Type
-    if forcetype != None:
+    if forcetype is not None:
         df.Type = forcetype
     df.Flags = (sf.Flags & COPY_FLAGS)
     dstfss.FSpSetFInfo(df)
index f16228b82876730e37da5baa775e84b73d032c24..952b919c33b6452852262fa84f43c6d3e054ada0 100644 (file)
@@ -188,7 +188,7 @@ class _Reader:
 
     def GetVideoFrameRate(self):
         tv = self.videocurtime
-        if tv == None:
+        if tv is None:
             tv = 0
         flags = QuickTime.nextTimeStep|QuickTime.nextTimeEdgeOK
         tv, dur = self.videomedia.GetMediaNextInterestingTime(flags, tv, 1.0)
@@ -199,7 +199,7 @@ class _Reader:
         if not time is None:
             self.audiocurtime = time
         flags = QuickTime.nextTimeStep|QuickTime.nextTimeEdgeOK
-        if self.audiocurtime == None:
+        if self.audiocurtime is None:
             self.audiocurtime = 0
         tv = self.audiomedia.GetMediaNextInterestingTimeOnly(flags, self.audiocurtime, 1.0)
         if tv < 0 or (self.audiocurtime and tv < self.audiocurtime):
@@ -215,7 +215,7 @@ class _Reader:
         if not time is None:
             self.videocurtime = time
         flags = QuickTime.nextTimeStep
-        if self.videocurtime == None:
+        if self.videocurtime is None:
             flags = flags | QuickTime.nextTimeEdgeOK
             self.videocurtime = 0
         tv = self.videomedia.GetMediaNextInterestingTimeOnly(flags, self.videocurtime, 1.0)
index fceb4c94f9d1347e368fa30d014056ec7b4a4ccb..a5f346872ae1d6d431f7c5ab7a0e1ae5707612c0 100644 (file)
@@ -143,7 +143,7 @@ def __read_group_file():
     while 1:
         entry = group.readline().strip()
         if len(entry) > 3:
-            if sep == None:
+            if sep is None:
                 sep = __get_field_sep(entry)
             fields = entry.split(sep)
             fields[2] = int(fields[2])
index 95d766a79c41fc71f1bbc5246a6f87e68059256e..ceb92d918c0b8f00d22cb26ec3ae03546234167c 100644 (file)
@@ -167,7 +167,7 @@ def __read_passwd_file():
     while 1:
         entry = passwd.readline().strip()
         if len(entry) > 6:
-            if sep == None:
+            if sep is None:
                 sep = __get_field_sep(entry)
             fields = entry.split(sep)
             for i in (2, 3):
index 03dd5b51934916f73dcfbddbba3079a116c074fb..e4f87f2c495db4d58e8927f15a257348c79ac3c2 100644 (file)
@@ -130,7 +130,7 @@ if __name__=='__main__' and sys.argv[1:] == ['-g']:
 
 def test_order(ast_node, parent_pos):
 
-    if not isinstance(ast_node, _ast.AST) or ast_node._fields == None:
+    if not isinstance(ast_node, _ast.AST) or ast_node._fields is None:
         return
     if isinstance(ast_node, (_ast.expr, _ast.stmt, _ast.excepthandler)):
         node_pos = (ast_node.lineno, ast_node.col_offset)
@@ -141,7 +141,7 @@ def test_order(ast_node, parent_pos):
         if isinstance(value, list):
             for child in value:
                 test_order(child, parent_pos)
-        elif value != None:
+        elif value is not None:
             test_order(value, parent_pos)
 
 def run_tests():
index 83802c1895aa6fca7e678d3da9623611786fe343..7a1225876b22fe01e9a8eb326ad328642ba6c8bd 100644 (file)
@@ -630,9 +630,9 @@ class TestMaildir(TestMailbox):
                                                                 "tmp")),
                              "File in wrong location: '%s'" % head)
             match = pattern.match(tail)
-            self.assert_(match != None, "Invalid file name: '%s'" % tail)
+            self.assert_(match is not None, "Invalid file name: '%s'" % tail)
             groups = match.groups()
-            if previous_groups != None:
+            if previous_groups is not None:
                 self.assert_(int(groups[0] >= previous_groups[0]),
                              "Non-monotonic seconds: '%s' before '%s'" %
                              (previous_groups[0], groups[0]))
index d1291a0d62eb0b2b76f06052706ed516babb897b..d747f2f682468a2d9b23f527d70e5797f73bdfab 100644 (file)
@@ -57,7 +57,7 @@ class PyclbrTest(TestCase):
             ignore are ignored.   If no module is provided, the appropriate
             module is loaded with __import__.'''
 
-        if module == None:
+        if module is None:
             # Import it.
             # ('<silly>' is to work around an API silliness in __import__)
             module = __import__(moduleName, globals(), {}, ['<silly>'])
index f5ae0266bce8ac89eada81d7b5cb6b497edff3ec..856434f67614e3bab90b26cf6dd5141d9583a367 100644 (file)
@@ -546,7 +546,7 @@ else:
                           expectedToWork,
                           certsreqs=None):
 
-        if certsreqs == None:
+        if certsreqs is None:
             certsreqs = ssl.CERT_NONE
 
         if certsreqs == ssl.CERT_NONE:
index bb9c294e5ed66ef54322dada145c774f4f0ae502..e6d1902df68f566d5f8a484ce483abf54bb0723e 100644 (file)
@@ -107,7 +107,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
         xmlreader.IncrementalParser.parse(self, source)
 
     def prepareParser(self, source):
-        if source.getSystemId() != None:
+        if source.getSystemId() is not None:
             self._parser.SetBase(source.getSystemId())
 
     # Redefined setContentHandler to allow changing handlers during parsing
index 8bdebe6806d0635a9f4109adfb25741276c641c6..37974e994a34d80b33e386f772489f6c2e0aa820 100755 (executable)
@@ -289,7 +289,7 @@ def runCommand(commandline):
     fd = os.popen(commandline, 'r')
     data = fd.read()
     xit = fd.close()
-    if xit != None:
+    if xit is not None:
         sys.stdout.write(data)
         raise RuntimeError, "command failed: %s"%(commandline,)
 
@@ -300,7 +300,7 @@ def captureCommand(commandline):
     fd = os.popen(commandline, 'r')
     data = fd.read()
     xit = fd.close()
-    if xit != None:
+    if xit is not None:
         sys.stdout.write(data)
         raise RuntimeError, "command failed: %s"%(commandline,)
 
index 172b40819c8fd3b7aa2e9b55c59fd6ad39a2eaca..383075337cc56708470107ee1c7936068e078b66 100644 (file)
@@ -26,7 +26,7 @@ class Utility_Events_Events:
         _subcode = 'SEL1'
 
         aetools.keysubst(_arguments, self._argmap_select_disk_image)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
@@ -52,7 +52,7 @@ class Utility_Events_Events:
         _subcode = 'SEL2'
 
         aetools.keysubst(_arguments, self._argmap_select_DiskScript)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
@@ -78,7 +78,7 @@ class Utility_Events_Events:
         _subcode = 'SEL3'
 
         aetools.keysubst(_arguments, self._argmap_select_disk_image_or_DiskScript)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
@@ -104,7 +104,7 @@ class Utility_Events_Events:
         _subcode = 'SEL4'
 
         aetools.keysubst(_arguments, self._argmap_select_floppy_disk_image)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
@@ -130,7 +130,7 @@ class Utility_Events_Events:
         _subcode = 'SEL5'
 
         aetools.keysubst(_arguments, self._argmap_select_disk)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
@@ -156,7 +156,7 @@ class Utility_Events_Events:
         _subcode = 'SEL6'
 
         aetools.keysubst(_arguments, self._argmap_select_folder)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
index 4f6604cfebec5fed8962b97f9c60fbf9dc141b47..0e62a02f57e284badb305d513571cdddecc74411 100644 (file)
@@ -103,7 +103,7 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _subcode = 'crel'
 
         aetools.keysubst(_arguments, self._argmap_make)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
index bd86a20a8386421148297056e7919d282e6af195..05c678f46ded27903a7f4bb51bc8f0481466dce8 100644 (file)
@@ -175,10 +175,10 @@ class AHVDocInstall(Command):
                 ('root', 'root'))
 #               import pdb ; pdb.set_trace()
         build_cmd = self.get_finalized_command('build')
-        if self.build_dest == None:
+        if self.build_dest is None:
             build_cmd = self.get_finalized_command('build')
             self.build_dest = build_cmd.build_dest
-        if self.install_doc == None:
+        if self.install_doc is None:
             self.install_doc = os.path.join(self.prefix, DESTDIR)
         print 'INSTALL', self.build_dest, '->', self.install_doc
 
index 7f635a0d1c0835bf19d5836dd002f0769a31fd13..ed5c88f6cb3d3a258dfbce4132f621ab9c6182c6 100644 (file)
@@ -183,7 +183,7 @@ class PackageMaker:
 
         # set folder attributes
         self.sourceFolder = root
-        if resources == None:
+        if resources is None:
             self.resourceFolder = root
         else:
             self.resourceFolder = resources
index 3da39589a979d732e60261b806064a85cedee3a7..3bdfb7286a7acc139493356298e369d5874316ba 100644 (file)
@@ -148,7 +148,7 @@ class FunctionGenerator(BaseFunctionGenerator):
         for arg in self.argumentList:
             if arg.flags == ErrorMode or arg.flags == SelfMode:
                 continue
-            if arg.type == None:
+            if arg.type is None:
                 str = 'void'
             else:
                 if hasattr(arg.type, 'typeName'):