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