Skip to content

Commit

Permalink
Fix running unsaved script in console
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 16, 2016
1 parent d64f474 commit 11ee2fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/console/console_editor.py
Expand Up @@ -633,7 +633,8 @@ def syntaxCheck(self, filename=None, fromContextMenu=True):
source = source.encode('utf-8')
if isinstance(filename, type(u"")):
filename = filename.encode('utf-8')
compile(source, filename, 'exec')
if filename:
compile(source, filename, 'exec')
except SyntaxError as detail:
eline = detail.lineno and detail.lineno or 1
ecolumn = detail.offset and detail.offset or 1
Expand Down

0 comments on commit 11ee2fc

Please sign in to comment.