Skip to content

Commit

Permalink
fix old "except Exception, e"
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpopel committed Dec 28, 2020
1 parent ffca752 commit 2ca82cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Treex/Tool/Python/execute.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
# coding=utf-8

"""
Expand Down Expand Up @@ -54,7 +54,7 @@
#print >> stderr, "Read line:\n" + line
#stderr.flush()
cmd += line
except Exception, e:
except Exception as e:
print >> sys.stderr, str(type(e)), ':', e
break
# execute each command when it's fully read
Expand All @@ -65,7 +65,7 @@
output.flush()
#print >> stderr, "Exec\'d:\n" + cmd
#stderr.flush()
except Exception, e:
except Exception as e:
cmd = re.sub(r'[^\n]+\n$', '', cmd)
_, _, tb = sys.exc_info()
print >> stderr, '\n\nCommand:', '\n', cmd, '\nException:\n', str(type(e)), ':', e, '\n\n', ''.join(traceback.format_tb(tb))
Expand Down

0 comments on commit 2ca82cd

Please sign in to comment.