Fix running unsaved script in console

This commit is contained in:
Nyall Dawson 2016-05-16 12:01:23 +10:00
parent d64f47404b
commit 11ee2fc809

View File

@ -633,7 +633,8 @@ class Editor(QsciScintilla):
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