From 7e3f2172564953b6eb2cbfc13eb07d7031cc7331 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 11 Aug 2009 14:46:26 -0400 Subject: Handle BugDir.list_uuids() in the case of missing ".be/bugs/". Previously: $ be init $ be list ... File ".../libbe/bugdir.py", line 537, in list_uuids for uuid in os.listdir(self.get_path("bugs")): OSError: [Errno 2] No such file or directory: '.../.be/bugs' --- libbe/bugdir.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libbe/bugdir.py') diff --git a/libbe/bugdir.py b/libbe/bugdir.py index 0eb4a6c..ee6c943 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -534,10 +534,11 @@ settings easy. Don't set this attribute. Set .rcs instead, and uuids = [] if self.sync_with_disk == True and os.path.exists(self.get_path()): # list the uuids on disk - for uuid in os.listdir(self.get_path("bugs")): - if not (uuid.startswith('.')): - uuids.append(uuid) - yield uuid + if os.path.exists(self.get_path("bugs")): + for uuid in os.listdir(self.get_path("bugs")): + if not (uuid.startswith('.')): + uuids.append(uuid) + yield uuid # and the ones that are still just in memory for bug in self: if bug.uuid not in uuids: -- cgit