From 11ee2fc809b62b424daa259d9063a3c4669e472e Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 16 May 2016 12:01:23 +1000 Subject: [PATCH] Fix running unsaved script in console --- python/console/console_editor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/console/console_editor.py b/python/console/console_editor.py index bca71c37c5e..9e00a5f3dcb 100644 --- a/python/console/console_editor.py +++ b/python/console/console_editor.py @@ -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