From 52b2c9d10de66a07dc26c39e37145bf10d9d4ded Mon Sep 17 00:00:00 2001 From: moculus Date: Thu, 18 Oct 2007 15:28:36 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- mode/python.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mode/python.py b/mode/python.py index 7b2eb6b..5926741 100644 --- a/mode/python.py +++ b/mode/python.py @@ -228,8 +228,9 @@ class PythonSetLib(method.Method): class PythonCheckSyntax(method.Method): '''Check the syntax of the current python file''' def _execute(self, w, **vargs): - syspath = list(sys.path) - sys.path.insert(0, w.mode.pythonlib) + if w.mode.pythonlib not in sys.path: + sys.path = list(sys.path) + sys.path.insert(0, w.mode.pythonlib) source = w.buffer.make_string() try: code = compile(source, w.buffer.path, 'exec') @@ -237,7 +238,6 @@ class PythonCheckSyntax(method.Method): except Exception, e: output = traceback.format_exc() w.application.data_buffer("*PythonSyntax*", output, switch_to=True) - sys.path = syspath class PythonDictCleanup(method.Method): '''Align assignment blocks and literal dictionaries'''