Browse Source

Fix more incorrect usages of 'is'

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Chris Larson 13 years ago
parent
commit
a26a2f5484
6 changed files with 17 additions and 17 deletions
  1. 3 3
      lib/bb/fetch/bzr.py
  2. 3 3
      lib/bb/fetch2/bzr.py
  3. 4 4
      lib/bb/fetch2/hg.py
  4. 2 2
      lib/bb/fetch2/osc.py
  5. 3 3
      lib/bb/fetch2/svn.py
  6. 2 2
      lib/bb/runqueue.py

+ 3 - 3
lib/bb/fetch/bzr.py

@@ -67,15 +67,15 @@ class Bzr(Fetch):
 
         options = []
 
-        if command is "revno":
+        if command == "revno":
             bzrcmd = "%s revno %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
         else:
             if ud.revision:
                 options.append("-r %s" % ud.revision)
 
-            if command is "fetch":
+            if command == "fetch":
                 bzrcmd = "%s co %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
-            elif command is "update":
+            elif command == "update":
                 bzrcmd = "%s pull %s --overwrite" % (basecmd, " ".join(options))
             else:
                 raise FetchError("Invalid bzr command %s" % command)

+ 3 - 3
lib/bb/fetch2/bzr.py

@@ -64,15 +64,15 @@ class Bzr(FetchMethod):
 
         options = []
 
-        if command is "revno":
+        if command == "revno":
             bzrcmd = "%s revno %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
         else:
             if ud.revision:
                 options.append("-r %s" % ud.revision)
 
-            if command is "fetch":
+            if command == "fetch":
                 bzrcmd = "%s co %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
-            elif command is "update":
+            elif command == "update":
                 bzrcmd = "%s pull %s --overwrite" % (basecmd, " ".join(options))
             else:
                 raise FetchError("Invalid bzr command %s" % command, ud.url)

+ 4 - 4
lib/bb/fetch2/hg.py

@@ -92,21 +92,21 @@ class Hg(FetchMethod):
         else:
             hgroot = ud.user + "@" + host + ud.path
 
-        if command is "info":
+        if command == "info":
             return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module)
 
         options = [];
         if ud.revision:
             options.append("-r %s" % ud.revision)
 
-        if command is "fetch":
+        if command == "fetch":
             cmd = "%s clone %s %s://%s/%s %s" % (basecmd, " ".join(options), proto, hgroot, ud.module, ud.module)
-        elif command is "pull":
+        elif command == "pull":
             # do not pass options list; limiting pull to rev causes the local
             # repo not to contain it and immediately following "update" command
             # will crash
             cmd = "%s pull" % (basecmd)
-        elif command is "update":
+        elif command == "update":
             cmd = "%s update -C %s" % (basecmd, " ".join(options))
         else:
             raise FetchError("Invalid hg command %s" % command, ud.url)

+ 2 - 2
lib/bb/fetch2/osc.py

@@ -68,9 +68,9 @@ class Osc(FetchMethod):
 
         coroot = self._strip_leading_slashes(ud.path)
 
-        if command is "fetch":
+        if command == "fetch":
             osccmd = "%s %s co %s/%s %s" % (basecmd, config, coroot, ud.module, " ".join(options))
-        elif command is "update":
+        elif command == "update":
             osccmd = "%s %s up %s" % (basecmd, config, " ".join(options))
         else:
             raise FetchError("Invalid osc command %s" % command, ud.url)

+ 3 - 3
lib/bb/fetch2/svn.py

@@ -85,7 +85,7 @@ class Svn(FetchMethod):
         if ud.pswd:
             options.append("--password %s" % ud.pswd)
 
-        if command is "info":
+        if command == "info":
             svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module)
         else:
             suffix = ""
@@ -93,9 +93,9 @@ class Svn(FetchMethod):
                 options.append("-r %s" % ud.revision)
                 suffix = "@%s" % (ud.revision)
 
-            if command is "fetch":
+            if command == "fetch":
                 svncmd = "%s co %s %s://%s/%s%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module)
-            elif command is "update":
+            elif command == "update":
                 svncmd = "%s update %s" % (basecmd, " ".join(options))
             else:
                 raise FetchError("Invalid svn command %s" % command, ud.url)

+ 2 - 2
lib/bb/runqueue.py

@@ -928,7 +928,7 @@ class RunQueue:
 
         if self.state is runQueuePrepare:
             self.rqexe = RunQueueExecuteDummy(self)
-            if self.rqdata.prepare() is 0:
+            if self.rqdata.prepare() == 0:
                 self.state = runQueueComplete
             else:
                 self.state = runQueueSceneInit
@@ -1017,7 +1017,7 @@ class RunQueueExecute:
         collect the process exit codes and close the information pipe.
         """
         result = os.waitpid(-1, os.WNOHANG)
-        if result[0] is 0 and result[1] is 0:
+        if result[0] == 0 and result[1] == 0:
             return None
         task = self.build_pids[result[0]]
         del self.build_pids[result[0]]