diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index bce7b0bf00f..d056ac320d9 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -530,7 +530,7 @@ class ProcessTestCase(BaseTestCase): subprocess.Popen(['nonexisting_i_hope'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - if c.exception.errno != 2: # ignore "no such file" + if c.exception.errno != errno.ENOENT: # ignore "no such file" raise c.exception def test_handles_closed_on_exception(self): diff --git a/Misc/NEWS b/Misc/NEWS index 4c9631fa1df..558c4f343eb 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -357,6 +357,8 @@ Build Tests ----- +- Issue #9894: Do not hardcode ENOENT in test_subprocess. + - Issue #9323: Make test.regrtest.__file__ absolute, this was not always the case when running profile or trace, for example.