From e311b1dbe206bc6ec08ba2ece73ac35000a1b7e4 2017-02-03 14:31:33 From: Thomas Kluyver Date: 2017-02-03 14:31:33 Subject: [PATCH] Merge pull request #10239 from segevfiner/editorhooks-wait-fix IPython/lib/editorhooks.py: wait for process even if wait=False --- 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):