X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=bin%2Fcompyle4vim.py;h=08f93244ec2735d170a937a6f3ddf98f1390e07d;hb=7bc97fc1d57dbae21c1feab20ce112e3be78c634;hp=8b5c78b7546cc2c73eee7fb38c95584e16e66d18;hpb=f46bd4d41cc7f243bc8a321effee5200aa69e709;p=dotfiles.git diff --git a/bin/compyle4vim.py b/bin/compyle4vim.py index 8b5c78b..08f9324 100755 --- a/bin/compyle4vim.py +++ b/bin/compyle4vim.py @@ -1,5 +1,4 @@ -#! /usr/bin/env python - +#! /usr/bin/env python3 import sys, os @@ -17,12 +16,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