diff options
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r-- | Lib/test/test_os.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 6dbc255612..3f6e48f0c8 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1589,6 +1589,16 @@ class ExecTests(unittest.TestCase): with self.assertRaises(ValueError): os.execve(args[0], args, newenv) + @unittest.skipUnless(sys.platform == "win32", "Win32-specific test") + def test_execve_with_empty_path(self): + # bpo-32890: Check GetLastError() misuse + try: + os.execve('', ['arg'], {}) + except OSError as e: + self.assertTrue(e.winerror is None or e.winerror != 0) + else: + self.fail('No OSError raised') + @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests") class Win32ErrorTests(unittest.TestCase): |