Skip to content

Commit 89261a2

Browse files
mihmatthew-brett
authored andcommitted
Relax dep in Python version due to 'except Exception as ...'
Thanks Matthew for pointing it out. Also send error messages to stderr.
1 parent 26ab059 commit 89261a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/parrec2nii

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def verbose(msg, indent=0):
7878
print "%s%s" % (' ' * indent, msg)
7979

8080
def error(msg, exit_code):
81-
print msg
81+
print >> sys.stderr, msg
8282
sys.exit(exit_code)
8383

8484
def proc_file(infile, opts):
@@ -198,7 +198,8 @@ def main():
198198
verbose('Processing %s' % infile)
199199
try:
200200
proc_file(infile, opts)
201-
except Exception as err:
201+
except Exception:
202+
err = sys.exc_info()[1]
202203
errs.append('%s: %s' % (infile, err))
203204

204205
if len(errs):

0 commit comments

Comments
 (0)