diff --git a/src/rougail/xmlreflector.py b/src/rougail/xmlreflector.py index 48bf50bb4..19e7831d1 100644 --- a/src/rougail/xmlreflector.py +++ b/src/rougail/xmlreflector.py @@ -65,6 +65,8 @@ class XMLReflector: filenames = [join(xmlfolder, filename) for filename in listdir(xmlfolder) if \ filename.endswith('.xml')] filenames.sort() + if not filenames: + raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder]) for xmlfile in filenames: try: document = parse(xmlfile) diff --git a/tests/dictionaries/80empty_dir/__init__.py b/tests/dictionaries/80empty_dir/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/dictionaries/80empty_dir/errno_77 b/tests/dictionaries/80empty_dir/errno_77 new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test_upgrade.py b/tests/test_upgrade.py index 629261bc6..5cd5aa119 100644 --- a/tests/test_upgrade.py +++ b/tests/test_upgrade.py @@ -54,7 +54,7 @@ def launch_test(test_dir): except Exception as err: # import traceback # traceback.print_exc() - print(f'cannot convert {test_dir}: {err}') + # print(f'cannot convert {test_dir}: {err}') rmtree(new_dest_dir) copytree(test_dir, new_dest_dir) return