From 1a550b8ef164af0bd26e355cdd761ce60793d72f Mon Sep 17 00:00:00 2001 From: TomCC Date: Mon, 17 Nov 2014 13:03:56 -0500 Subject: [PATCH] Fix Python BOM script bug when output file cannot be opened. (fixes:lp:1391904) --- scripts/bom-in-python/bom_csv_grouped_by_value.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/bom-in-python/bom_csv_grouped_by_value.py b/scripts/bom-in-python/bom_csv_grouped_by_value.py index 29203e33f2..3051b93bba 100644 --- a/scripts/bom-in-python/bom_csv_grouped_by_value.py +++ b/scripts/bom-in-python/bom_csv_grouped_by_value.py @@ -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 block in kicad_netlist_reader.py