Skip to content

Commit

Permalink
wmlxgettext: Fix crash if no *.cfg file is found
Browse files Browse the repository at this point in the history
fixes #3719
[ci skip]
  • Loading branch information
jostephd authored and sevu committed Nov 14, 2018
1 parent 43097b3 commit 8cf9074
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions data/tools/pywmlx/autof.py
Expand Up @@ -4,7 +4,7 @@


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:
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion data/tools/wmlxgettext
Expand Up @@ -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 "
Expand Down

0 comments on commit 8cf9074

Please sign in to comment.