Skip to content

Commit 980a045

Browse files
committed
Fix exception-handling mistake in CLI
1 parent 3f34823 commit 980a045

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

zxing/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ def main():
4949
else:
5050
ff = fn
5151

52+
bc = None
5253
try:
5354
bc = bcr.decode(ff, try_harder=args.try_harder, pure_barcode=args.pure_barcode)
5455
except BarCodeReaderException as e:
5556
p.error(e.message + ((': ' + e.filename) if e.filename else '') + (('\n\tCaused by: ' + repr(e.__cause__) if e.__cause__ else '')))
57+
5658
if args.csv:
5759
wr.writerow((fn, bc.format, bc.type, bc.raw, bc.parsed) if bc else (fn, 'ERROR', None, None, None))
5860
else:

0 commit comments

Comments
 (0)