parent
c64d639dee
commit
634c8b88f1
|
@ -209,6 +209,7 @@ class PythonCheckSyntax(Method):
|
|||
'''Check the syntax of the current python file'''
|
||||
def _execute(self, w, **vargs):
|
||||
pythonlib = w.application.config.get('python.lib')
|
||||
old_path = sys.path
|
||||
if pythonlib:
|
||||
sys.path.insert(0, pythonlib)
|
||||
source = w.buffer.make_string()
|
||||
|
@ -217,9 +218,10 @@ class PythonCheckSyntax(Method):
|
|||
w.set_error("Syntax OK")
|
||||
except Exception, e:
|
||||
output = traceback.format_exc()
|
||||
w.application.data_buffer("*PythonSyntax*", output, switch_to=True,
|
||||
w.application.data_buffer("*PythonSyntax*", output,
|
||||
switch_to=True,
|
||||
modename='error')
|
||||
del sys.path[0]
|
||||
sys.path = old_path
|
||||
|
||||
class PythonDictCleanup(Method):
|
||||
'''Align assignment blocks and literal dictionaries'''
|
||||
|
|
Loading…
Reference in New Issue