[Buildbot-commits] buildbot/buildbot scheduler.py,1.15,1.16 master.py,1.91,1.92

Brian Warner warner at users.sourceforge.net
Mon Apr 17 19:22:36 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23634/buildbot

Modified Files:
	scheduler.py master.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-500
Creator:  Brian Warner <warner at lothar.com>

fix process_twisted.py factories, other style changes

	* all: use isinstance() instead of 'type(x) is foo', suggested by
	Neal Norwitz

	* buildbot/process/process_twisted.py (QuickTwistedBuildFactory):
	oops, fix a brain-fade from the other week, when making the
	addStep changes. I changed all the __init__ upcalls to use the
	wrong superclass name.
	(FullTwistedBuildFactory.__init__): same
	(TwistedDebsBuildFactory.__init__): same
	(TwistedReactorsBuildFactory.__init__): same
	(TwistedBuild.isFileImportant): use .startswith for clarity,
	thanks to Neal Norwitz for the suggestions.


Index: master.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- master.py	13 Jan 2006 08:34:28 -0000	1.91
+++ master.py	17 Apr 2006 19:22:34 -0000	1.92
@@ -746,15 +746,15 @@
         if config.has_key('interlocks'):
             raise KeyError("c['interlocks'] is no longer accepted")
 
-        assert type(sources) in (list, tuple)
+        assert isinstance(sources, (list, tuple))
         for s in sources:
             assert interfaces.IChangeSource(s, None)
         # this assertion catches c['schedulers'] = Scheduler(), since
         # Schedulers are service.MultiServices and thus iterable.
-        assert type(schedulers) in (list, tuple)
+        assert isinstance(schedulers, (list, tuple))
         for s in schedulers:
             assert interfaces.IScheduler(s, None)
-        assert type(status) in (list, tuple)
+        assert isinstance(status, (list, tuple))
         for s in status:
             assert interfaces.IStatusReceiver(s, None)
 

Index: scheduler.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scheduler.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- scheduler.py	12 Mar 2006 11:28:04 -0000	1.15
+++ scheduler.py	17 Apr 2006 19:22:34 -0000	1.16
@@ -108,7 +108,7 @@
         BaseUpstreamScheduler.__init__(self, name)
         self.treeStableTimer = treeStableTimer
         for b in builderNames:
-            assert type(b) is str
+            assert isinstance(b, str)
         self.builderNames = builderNames
         self.branch = branch
         if fileIsImportant:
@@ -225,7 +225,7 @@
         BaseUpstreamScheduler.__init__(self, name)
         self.treeStableTimer = treeStableTimer
         for b in builderNames:
-            assert type(b) is str
+            assert isinstance(b, str)
         self.builderNames = builderNames
         self.branches = branches
         if self.branches == []:





More information about the Commits mailing list