Skip to content

Commit

Permalink
Merge from 3.x: PR #5246
Browse files Browse the repository at this point in the history
Fixes #5053
  • Loading branch information
ccordoba12 committed Sep 15, 2017
2 parents d276f36 + 1c1cb40 commit 902cc75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions spyder/plugins/ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,10 @@ def run_script(self, filename, wdir, args, debug, post_mortem,
line += "\"%s\"" % to_text_string(filename)
if args:
line += " %s" % norm(args)
self.execute_code(line, current_client, clear_variables)
try:
self.execute_code(line, current_client, clear_variables)
except AttributeError:
pass
self.visibility_changed(True)
self.raise_()
else:
Expand Down Expand Up @@ -922,7 +925,7 @@ def execute_code(self, lines, current_client=True, clear_variables=False):
sw.reset_namespace(warning=False, silent=True)
elif current_client and clear_variables:
sw.reset_namespace(warning=False, silent=True)
sw.execute(to_text_string(to_text_string(lines)))
sw.execute(to_text_string(lines))
self.activateWindow()
self.get_current_client().get_control().setFocus()

Expand Down
5 changes: 4 additions & 1 deletion spyder/widgets/ipythonconsole/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ def create_shortcuts(self):
# --- To communicate with the kernel
def silent_execute(self, code):
"""Execute code in the kernel without increasing the prompt"""
self.kernel_client.execute(to_text_string(code), silent=True)
try:
self.kernel_client.execute(to_text_string(code), silent=True)
except AttributeError:
pass

def silent_exec_method(self, code):
"""Silently execute a kernel method and save its reply
Expand Down

0 comments on commit 902cc75

Please sign in to comment.