From 2ca82cd7a7211ac5e7b29c498fc690b7ad44bd39 Mon Sep 17 00:00:00 2001 From: Martin Popel Date: Mon, 28 Dec 2020 11:37:36 +0100 Subject: [PATCH] fix old "except Exception, e" --- lib/Treex/Tool/Python/execute.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Treex/Tool/Python/execute.py b/lib/Treex/Tool/Python/execute.py index 6a9585f398..0abcfa897a 100755 --- a/lib/Treex/Tool/Python/execute.py +++ b/lib/Treex/Tool/Python/execute.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # coding=utf-8 """ @@ -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 @@ -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))