Commit 68c4f16a authored by André Anjos's avatar André Anjos 💬
Browse files

[server] NotADirectoryError does not exist on py2x, use IOError instead

parent a5d2b08f
Pipeline #19803 failed with stages
in 149 minutes and 33 seconds
...@@ -140,7 +140,7 @@ def generate_file_tree(entity, config): ...@@ -140,7 +140,7 @@ def generate_file_tree(entity, config):
assert_valid_entity(entity) assert_valid_entity(entity)
resource_path = os.path.join(config.path, entity) resource_path = os.path.join(config.path, entity)
if not os.path.isdir(resource_path): if not os.path.isdir(resource_path):
raise NotADirectoryError('Invalid resource path %s' % resource_path) raise IOError('Invalid resource path %s' % resource_path)
return path_to_dict(resource_path) return path_to_dict(resource_path)
...@@ -304,7 +304,7 @@ def gen_endpoint(entity): ...@@ -304,7 +304,7 @@ def gen_endpoint(entity):
"""Regenerates the entity tree""" """Regenerates the entity tree"""
try: try:
return generate_entity_tree(entity, self.config) return generate_entity_tree(entity, self.config)
except NotADirectoryError: except IOError:
return [] return []
def get(self): def get(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment