Applied a patch from dkg@fifthhorseman.net: py3 compatibility: Use modern form of exception handling

- Legacy-Id: 15890
This commit is contained in:
Henrik Levkowetz 2019-01-14 21:00:50 +00:00
parent 8840efaef4
commit e718272e71

View file

@ -1325,8 +1325,8 @@ def _main(outfile=sys.stdout):
try:
opts, files = getopt.gnu_getopt(sys.argv[1:], "dhatTv", ["debug", "getauthors", "attribs", "attributes", "help", "timestamp", "notimestamp", "trace", "version",])
except Exception, e:
print "%s: %s" % (program, e)
except Exception as e:
print("%s: %s" % (program, e))
sys.exit(1)
# parse options
@ -1396,7 +1396,7 @@ if __name__ == "__main__":
_main()
except KeyboardInterrupt:
raise
except Exception, e:
except Exception as e:
if opt_debug:
raise
else: