do not allow empty XML directory
This commit is contained in:
parent
f18a53d61a
commit
e75965fad2
@ -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)
|
||||
|
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:
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user