makeqstrdata: print error to stderr.
This commit is contained in:
parent
6fc765c928
commit
fdf0da5436
|
@ -1,5 +1,6 @@
|
||||||
import argparse
|
import argparse
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
# codepoint2name is different in Python 2 to Python 3
|
# codepoint2name is different in Python 2 to Python 3
|
||||||
import platform
|
import platform
|
||||||
|
@ -37,7 +38,7 @@ def do_work(infiles):
|
||||||
# verify line is of the correct form
|
# verify line is of the correct form
|
||||||
match = re.match(r'Q\((.+)\)$', line)
|
match = re.match(r'Q\((.+)\)$', line)
|
||||||
if not match:
|
if not match:
|
||||||
print('({}:{}) bad qstr format, got {}'.format(infile, line_number, line))
|
print('({}:{}) bad qstr format, got {}'.format(infile, line_number, line), file=sys.stderr)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# get the qstr value
|
# get the qstr value
|
||||||
|
@ -68,7 +69,7 @@ def main():
|
||||||
|
|
||||||
result = do_work(args.files)
|
result = do_work(args.files)
|
||||||
if not result:
|
if not result:
|
||||||
print('exiting with error code')
|
print('exiting with error code', file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue