diff options
author | W. Trevor King <wking@drexel.edu> | 2009-08-11 14:46:26 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-08-11 14:46:26 -0400 |
commit | 7e3f2172564953b6eb2cbfc13eb07d7031cc7331 (patch) | |
tree | 921672d963c1f4950f4facf071adb117661b1c04 /libbe/bugdir.py | |
parent | c25e74648ec248954ada82922c8221e8f4c7b09d (diff) | |
download | bugseverywhere-7e3f2172564953b6eb2cbfc13eb07d7031cc7331.tar.gz |
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'
Diffstat (limited to 'libbe/bugdir.py')
-rw-r--r-- | libbe/bugdir.py | 9 |
1 files changed, 5 insertions, 4 deletions
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: |