From: Oleg Broytman Date: Thu, 17 Nov 2016 13:01:26 +0000 (+0300) Subject: compyle4vim.py: adapt for Python 3 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=b1d0980bb6e404ca147bd3484320e1d32e2f9857;p=dotfiles.git compyle4vim.py: adapt for Python 3 --- diff --git a/bin/compyle4vim.py b/bin/compyle4vim.py index 8b5c78b..88a5705 100755 --- a/bin/compyle4vim.py +++ b/bin/compyle4vim.py @@ -17,12 +17,15 @@ try: template.compile() else: compile(codestring, filename, "exec") -except SyntaxError, detail: - pass +except SyntaxError as detail: + msg = str(detail) + filename = detail.filename + lineno = detail.lineno + offset = detail.offset + lineno = detail.lineno else: sys.exit() -msg, (_fname, lineno, offset, line) = detail if offset is None: offset = 1 sys.stderr.write(""" File "%s", line %d, column %d