Calling _findfilesstartingwith with a non-existing folder would raise an exception, will return an empty list now

This commit is contained in:
Patrick Speiser
2012-10-07 05:51:55 +02:00
parent 48ed99c380
commit 5695c8196a

View File

@@ -65,7 +65,8 @@ class Cache(object):
def _findfilesstartingwith(self,pattern,folder):
files = []
for fname in os.listdir(folder):
if os.path.exists(folder):
for fname in os.listdir(folder):
if fname.startswith(pattern):
files.append(os.path.join(folder,fname))
return files