fixed sys.stderr
This commit is contained in:
parent
642330e22c
commit
3882f3bfa5
1 changed files with 6 additions and 6 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#
|
||||
# Anything else is an error.
|
||||
|
||||
from __future__ import print_function
|
||||
import re
|
||||
import sys
|
||||
import argparse
|
||||
|
|
@ -32,6 +33,9 @@ import argparse
|
|||
re_func = re.compile(r"""^(.*[\* ])([A-Za-z_][A-Za-z0-9_]*)\((.*)\);$""")
|
||||
re_param = re.compile(r"""^(.*[\* ])([A-Za-z_][A-Za-z0-9_]*)$""")
|
||||
|
||||
def eprint(*args, **kwargs):
|
||||
print(*args, file=sys.stderr, **kwargs)
|
||||
|
||||
class Entry:
|
||||
"""Small class used to model a single DLL entry point."""
|
||||
def __init__(self, func_name, return_type, parameters):
|
||||
|
|
@ -413,9 +417,7 @@ def parse_file(filename, lines, mode):
|
|||
entries, prefix_name, verbatim, errors = parse_entries_file(lines)
|
||||
if errors:
|
||||
for error in errors:
|
||||
print("ERROR: %s:%s" % (filename, error))
|
||||
#FIXME
|
||||
#print >> sys.stderr, "ERROR: %s:%s" % (filename, error)
|
||||
eprint("ERROR: %s:%s" % (filename, error), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if not prefix_name:
|
||||
|
|
@ -468,9 +470,7 @@ parser.add_argument("file", help=".entries file path")
|
|||
args = parser.parse_args()
|
||||
|
||||
if not args.mode:
|
||||
print("ERROR: Please use --mode=<name>, see --help.")
|
||||
#FIXME
|
||||
#print >> sys.stderr, "ERROR: Please use --mode=<name>, see --help."
|
||||
eprint("ERROR: Please use --mode=<name>, see --help.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if args.output:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue