From eefc8c60865bc25a6cf5187634aa5eb4d6f05530 Mon Sep 17 00:00:00 2001 From: moculus Date: Sun, 22 Jul 2007 18:27:16 +0000 Subject: [PATCH] fixed syntax checker --HG-- branch : pmacs2 --- mode/python.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mode/python.py b/mode/python.py index eada39a..aa634ec 100644 --- a/mode/python.py +++ b/mode/python.py @@ -212,7 +212,13 @@ class PythonSetLib(method.Method): class PythonCheckSyntax(method.Method): '''Check the syntax of the current python file''' def _execute(self, w, **vargs): - mod = os.path.splitext(os.path.basename(w.buffer.path))[0] + mod = os.path.splitext(w.buffer.path)[0] + cwd = os.getcwd() + '/' + if mod.startswith(cwd): + mod = mod.replace(cwd, '', 1) + else: + mod = os.path.basename(mod) + mod = mod.replace('/', '.') cmd = "PYTHONPATH=%s python -c 'import %s'" % (w.mode.pythonlib, mod) (status, output) = commands.getstatusoutput(cmd) if status == 0: