wmlxgettext: Fix crash if no *.cfg file is found

fixes #3719
[ci skip]
This commit is contained in:
josteph 2018-11-14 19:47:31 +01:00 committed by Severin Glöckner
parent c4e9c389a6
commit e642223017
2 changed files with 2 additions and 6 deletions

View file

@ -4,7 +4,7 @@ import re
def autoscan(pathdir):
filelist = None
filelist = []
parentdir = os.path.realpath(os.path.join(pathdir, '..'))
for root, dirs, files in os.walk(pathdir, topdown=False):
for name in files:
@ -17,10 +17,7 @@ def autoscan(pathdir):
value = re.sub(r'^\/', '', value)
else:
value = re.sub(r'^(?:[A-Za-z]\:)?\\', '', value)
if filelist is None:
filelist = [ value ]
else:
filelist.append(value)
filelist.append(value)
# end if m
# end for name
# end for root

View file

@ -176,7 +176,6 @@ def main():
fdebug = open('debug.txt', 'w', encoding='utf-8')
pywmlx.statemachine.setup(sentlist, args.initdom, args.domain,
args.warnall, fdebug)
filelist = None
if args.recursive is False and args.filelist is None:
pywmlx.wmlerr("bad command line", "FILELIST must not be empty. "
"Please, run wmlxgettext again and, this time, add some file "