diff --git a/IPython/lib/editorhooks.py b/IPython/lib/editorhooks.py index 2d263a0..905eabe 100644 --- a/IPython/lib/editorhooks.py +++ b/IPython/lib/editorhooks.py @@ -53,7 +53,7 @@ def install_editor(template, wait=False): if sys.platform.startswith('win'): cmd = shlex.split(cmd) proc = subprocess.Popen(cmd, shell=True) - if wait and proc.wait() != 0: + if proc.wait() != 0: raise TryNext() if wait: py3compat.input("Press Enter when done editing:") diff --git a/IPython/lib/tests/test_editorhooks.py b/IPython/lib/tests/test_editorhooks.py index 862edc9..658276c 100644 --- a/IPython/lib/tests/test_editorhooks.py +++ b/IPython/lib/tests/test_editorhooks.py @@ -14,6 +14,7 @@ def test_install_editor(): 'args': args, 'kwargs': kwargs, }) + return mock.MagicMock(**{'wait.return_value': 0}) editorhooks.install_editor('foo -l {line} -f {filename}', wait=False) with mock.patch('subprocess.Popen', fake_popen):