Skip to content

Commit 19e2a2e

Browse files
committed
Fix a couple of issues detected by our tests
1 parent 79885b7 commit 19e2a2e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

spyder/plugins/ipythonconsole/utils/tests/test_spyder_kernel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def test_kernel_pypath(tmpdir, default_interpreter):
4343
# Restore default values
4444
CONF.set('main_interpreter', 'default', True)
4545
CONF.set('pythonpath_manager', 'spyder_pythonpath', [])
46+
del os.environ['PYTHONPATH']
4647

4748

4849
def test_python_interpreter(tmpdir):

spyder/plugins/ipythonconsole/widgets/client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,14 @@ def _when_prompt_is_ready(self):
232232
self.shellwidget.sig_remote_execute.disconnect(
233233
self._when_prompt_is_ready)
234234

235-
# It's necessary to do this at this point to avoid giving
236-
# focus to _control at startup.
237-
self._connect_control_signals()
235+
# Notes:
236+
# 1. It's necessary to do this at this point to avoid giving focus to
237+
# _control at startup.
238+
# 2. The try except is needed to avoid some errors in our tests.
239+
try:
240+
self._connect_control_signals()
241+
except RuntimeError:
242+
pass
238243

239244
if self.give_focus:
240245
self.shellwidget._control.setFocus()

0 commit comments

Comments
 (0)