projects
/
tools
/
python-jenkinsapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d3475b
)
FIX: TypeError: 'NoneType' object is unsubscriptable when _data[buildtype] == None
author
Ruslan Lutsenko
<ruslan.lutcenko@gmail.com>
Thu, 8 Mar 2012 09:44:57 +0000
(10:44 +0100)
committer
Ruslan Lutsenko
<ruslan.lutcenko@gmail.com>
Thu, 8 Mar 2012 09:44:57 +0000
(10:44 +0100)
jenkinsapi/job.py
patch
|
blob
|
history
diff --git
a/jenkinsapi/job.py
b/jenkinsapi/job.py
index dfb6fafce1044304084118be0eb1d4705dfe5188..bb98143949d755fac68f824d3c2cd7cf9bb4a4ea 100644
(file)
--- a/
jenkinsapi/job.py
+++ b/
jenkinsapi/job.py
@@
-102,6
+102,8
@@
class Job(JenkinsBase):
"""Gets a buildid for a given type of build"""
KNOWNBUILDTYPES=["lastSuccessfulBuild", "lastBuild", "lastCompletedBuild"]
assert buildtype in KNOWNBUILDTYPES
+ if self._data[buildtype] == None:
+ return None
buildid = self._data[buildtype]["number"]
assert type(buildid) == int, "Build ID should be an integer, got %s" % repr( buildid )
return buildid