Fix Python BOM script bug when output file cannot be opened. (fixes:lp:1391904)

This commit is contained in:
TomCC 2014-11-17 13:03:56 -05:00 committed by Wayne Stambaugh
parent 1ebaf1371a
commit 1a550b8ef1
1 changed files with 2 additions and 1 deletions

View File

@ -26,8 +26,9 @@ net = kicad_netlist_reader.netlist(sys.argv[1])
try:
f = open(sys.argv[2], 'w')
except IOError:
e = "Can't open output file for writing: " + sys.argv[2]
print(__file__, ":", e, file=sys.stderr)
f = stdout
f = sys.stdout
# subset the components to those wanted in the BOM, controlled
# by <configure> block in kicad_netlist_reader.py