Catch less errors

This commit is contained in:
Markus Unterwaditzer 2015-01-01 16:22:00 +01:00
parent b548c27384
commit 7bb7191526

View file

@ -7,6 +7,7 @@
:license: MIT, see LICENSE for more details.
'''
import errno
import os
from .base import Item, Storage
@ -53,8 +54,8 @@ class FilesystemStorage(Storage):
path = expand_path(path)
try:
collections = os.listdir(path)
except OSError:
if not kwargs.get('create', True):
except OSError as e:
if e.errno != errno.ENOENT:
raise
else:
for collection in collections: