Fix syntax warning emitted when using Python 2.7.3
authorJason Duell <jduell.mcbugs@gmail.com>
Wed, 20 Feb 2013 15:50:37 -0800
changeset 71 34334b242ec7
parent 70 6fe550e5b4e3
child 72 a0d199c0673e
push id52
push userjduell@mozilla.com
push date2013-02-20 23:51 +0000
Fix syntax warning emitted when using Python 2.7.3
bz.py
--- a/bz.py
+++ b/bz.py
@@ -235,17 +235,17 @@ class Comment(object):
 
 class Bug(object):
   def __init__(self, ui, data):
     self.settings = Settings(ui)
     xml = xmlfromstring(data)
     bug = xml.find("bug")
     self.num = int(bug.find('bug_id').text)
     sdesc = bug.find('short_desc')
-    self.title = sdesc.text if sdesc else "[empty]"
+    self.title = sdesc.text if sdesc is not None else "[empty]"
     self.comments = [Comment(n) for n in xml.findall("bug/long_desc")]
     self.desc = self.comments[0].text if len(self.comments)>0 else ""
     self.attachments = [Attachment.parse(self, a) for a in xml.findall("bug/attachment")]
     if bug.get("error") == "NotPermitted":
       raise PermissionError("Not allowed to access bug.  (Perhaps it is marked with a security group?)")
 
     # Add to cache so we can avoid network lookup later in this process
     cache[self.num] = self