From 8634003f4a85e03108e055155015579191fa9c39 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 16 Nov 2008 14:32:19 -0500 Subject: [PATCH] Fix Bug.string() handling of None times. --- libbe/bug.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libbe/bug.py b/libbe/bug.py index a0054ca..f973cf0 100644 --- a/libbe/bug.py +++ b/libbe/bug.py @@ -118,8 +118,12 @@ class Bug(object): bugs = list(self.bugdir.list()) short_name = names.unique_name(self, bugs) if shortlist == False: - htime = utility.handy_time(self.time) - ftime = utility.time_to_str(self.time) + if self.time == None: + timestring = "" + else: + htime = utility.handy_time(self.time) + ftime = utility.time_to_str(self.time) + timestring = "%s (%s)" % (htime, ftime) info = [("ID", self.uuid), ("Short name", short_name), ("Severity", self.severity), @@ -127,7 +131,7 @@ class Bug(object): ("Assigned", self.assigned), ("Target", self.target), ("Creator", self.creator), - ("Created", "%s (%s)" % (htime, ftime))] + ("Created", timestring)] newinfo = [] for k,v in info: if v == None: -- 2.26.2