Change error output to stderr.

Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
Keith Rothman 2019-07-08 11:20:53 -07:00
parent b77c47b155
commit 3d1fade706
2 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import os
import os, sys
from prjxray import util
@ -21,9 +21,9 @@ def run(fn_ins, fn_out, strict=False, track_origin=False, verbose=False):
if tag in tags:
orig_bits, orig_line, orig_origin = tags[tag]
if orig_bits != bits:
print("WARNING: got duplicate tag %s" % (tag, ))
print(" Orig line: %s" % orig_line)
print(" New line : %s" % line)
print("WARNING: got duplicate tag %s" % (tag, ), file=sys.stderr)
print(" Orig line: %s" % orig_line, file=sys.stderr)
print(" New line : %s" % line, file=sys.stderr)
assert not strict, "strict: got duplicate tag"
origin = os.path.basename(os.getcwd())
if track_origin and orig_origin != origin:
@ -31,9 +31,9 @@ def run(fn_ins, fn_out, strict=False, track_origin=False, verbose=False):
if bits in bitss:
orig_tag, orig_line = bitss[bits]
if orig_tag != tag:
print("WARNING: got duplicate bits %s" % (bits, ))
print(" Orig line: %s" % orig_line)
print(" New line : %s" % line)
print("WARNING: got duplicate bits %s" % (bits, ), file=sys.stderr)
print(" Orig line: %s" % orig_line, file=sys.stderr)
print(" New line : %s" % line, file=sys.stderr)
assert not strict, "strict: got duplicate bits"
if track_origin and origin is None:

View File

@ -20,8 +20,8 @@ def run(fnin, fnout=None, strict=False, verbose=False):
if mode != "always":
assert not mode, "strict: got ill defined line: %s" % (line, )
if tag in tags:
print("Original line: %s" % tags[tag])
print("New line: %s" % line)
print("Original line: %s" % tags[tag], file=sys.stderr)
print("New line: %s" % line, file=sys.stderr)
assert 0, "strict: got duplicate tag %s" % (tag, )
assert bits not in bitss, "strict: got duplicate bits %s: %s %s" % (
bits, tag, bitss[bits])