From 68c4f16a0fc7d0203d55a235eae5ea56752ad512 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Fri, 4 May 2018 08:10:41 +0200 Subject: [PATCH] [server] NotADirectoryError does not exist on py2x, use IOError instead --- beat/editor/resources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beat/editor/resources.py b/beat/editor/resources.py index 2c3053f7..ae5def8a 100644 --- a/beat/editor/resources.py +++ b/beat/editor/resources.py @@ -140,7 +140,7 @@ def generate_file_tree(entity, config): assert_valid_entity(entity) resource_path = os.path.join(config.path, entity) 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) @@ -304,7 +304,7 @@ def gen_endpoint(entity): """Regenerates the entity tree""" try: return generate_entity_tree(entity, self.config) - except NotADirectoryError: + except IOError: return [] def get(self): -- GitLab