From b1d0980bb6e404ca147bd3484320e1d32e2f9857 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 17 Nov 2016 16:01:26 +0300 Subject: [PATCH] compyle4vim.py: adapt for Python 3 --- bin/compyle4vim.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 -- 2.39.5