From: W. Trevor King Date: Mon, 21 Sep 2009 13:52:28 +0000 (-0400) Subject: os.path.isdir() -> .exists() for check for "comments" file. X-Git-Tag: 1.0.0~62^2~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e174881e3e39fbffa75aa0a1f858998827ad204c;p=be.git os.path.isdir() -> .exists() for check for "comments" file. "comments" should always be a directory if it exists, but if it is something else, be should fail rather than return an empty comment list. This fix was inspired by some browsing around in response to Thomas Habets' version of a fix for missing "bugs" directory. --- diff --git a/libbe/comment.py b/libbe/comment.py index 19c556f..41bc7e6 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -128,7 +128,7 @@ def loadComments(bug, load_full=False): if bug.sync_with_disk == False: raise DiskAccessRequired("load comments") path = bug.get_path("comments") - if not os.path.isdir(path): + if not os.path.exists(path): return Comment(bug, uuid=INVALID_UUID) comments = [] for uuid in os.listdir(path):