do not allow empty XML directory
This commit is contained in:
parent
f18a53d61a
commit
e75965fad2
4 changed files with 3 additions and 1 deletions
|
@ -65,6 +65,8 @@ class XMLReflector:
|
||||||
filenames = [join(xmlfolder, filename) for filename in listdir(xmlfolder) if \
|
filenames = [join(xmlfolder, filename) for filename in listdir(xmlfolder) if \
|
||||||
filename.endswith('.xml')]
|
filename.endswith('.xml')]
|
||||||
filenames.sort()
|
filenames.sort()
|
||||||
|
if not filenames:
|
||||||
|
raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder])
|
||||||
for xmlfile in filenames:
|
for xmlfile in filenames:
|
||||||
try:
|
try:
|
||||||
document = parse(xmlfile)
|
document = parse(xmlfile)
|
||||||
|
|
0
tests/dictionaries/80empty_dir/__init__.py
Normal file
0
tests/dictionaries/80empty_dir/__init__.py
Normal file
0
tests/dictionaries/80empty_dir/errno_77
Normal file
0
tests/dictionaries/80empty_dir/errno_77
Normal file
|
@ -54,7 +54,7 @@ def launch_test(test_dir):
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
# import traceback
|
# import traceback
|
||||||
# traceback.print_exc()
|
# traceback.print_exc()
|
||||||
print(f'cannot convert {test_dir}: {err}')
|
# print(f'cannot convert {test_dir}: {err}')
|
||||||
rmtree(new_dest_dir)
|
rmtree(new_dest_dir)
|
||||||
copytree(test_dir, new_dest_dir)
|
copytree(test_dir, new_dest_dir)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue