[Buildbot-commits] buildbot/buildbot/steps shell.py,1.18,1.19

Brian Warner warner at users.sourceforge.net
Fri Mar 21 04:25:33 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot/steps
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20662/buildbot/steps

Modified Files:
	shell.py 
Log Message:
[project @ shell.py: tolerate None in the value, since build status display was throwing an exception]

Original author: warner at lothar.com
Date: 2008-03-21 04:22:52+00:00

Index: shell.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/shell.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- shell.py	21 Mar 2008 03:53:36 -0000	1.18
+++ shell.py	21 Mar 2008 04:25:31 -0000	1.19
@@ -1,6 +1,6 @@
 # -*- test-case-name: buildbot.test.test_steps,buildbot.test.test_properties -*-
 
-import types, re
+import re
 from twisted.python import log
 from buildbot.process.buildstep import LoggingBuildStep, RemoteShellCommand, \
      render_properties
@@ -119,7 +119,7 @@
             return self.description
 
         words = self.command
-        if isinstance(words, types.StringTypes):
+        if isinstance(words, (str, unicode)):
             words = words.split()
         # render() each word to handle WithProperties objects
         words = [render_properties(word, self.build) for word in words]
@@ -135,19 +135,16 @@
         """
         Expand the L{WithProperties} objects in L{value}
         """
-        if isinstance(value, types.StringTypes) or \
-           isinstance(value, types.BooleanType) or \
-           isinstance(value, types.IntType) or \
-           isinstance(value, types.FloatType):
+        if isinstance(value, (str, unicode, bool, int, float, type(None))):
             return value
 
-        if isinstance(value, types.ListType):
+        if isinstance(value, list):
             return [self._interpolateProperties(val) for val in value]
 
-        if isinstance(value, types.TupleType):
+        if isinstance(value, tuple):
             return tuple([self._interpolateProperties(val) for val in value])
 
-        if isinstance(value, types.DictType):
+        if isinstance(value, dict):
             new_dict = { }
             for key, val in value.iteritems():
                 new_key = self._interpolateProperties(key)





More information about the Commits mailing list