diff options
author | Anthony Shaw <anthony.p.shaw@gmail.com> | 2019-05-10 12:00:06 +1000 |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-05-10 04:00:06 +0200 |
commit | 948ed8c96b6912541a608591efe3e00fb520429a (patch) | |
tree | f425a515663321d16ded48c9cedf94ddf5ca371f /Lib | |
parent | fce5ff1e18b522cf52379934a6560583d840e7f9 (diff) | |
download | cpython-git-948ed8c96b6912541a608591efe3e00fb520429a.tar.gz |
bpo-36814: ensure os.posix_spawn() handles None (GH-13144)
Fix an issue where os.posix_spawn() would incorrectly raise a TypeError
when file_actions is None.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_posix.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 843402930f..5c93d0d507 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -1550,6 +1550,15 @@ class _PosixSpawnMixin: with open(envfile) as f: self.assertEqual(f.read(), 'bar') + def test_none_file_actions(self): + pid = self.spawn_func( + self.NOOP_PROGRAM[0], + self.NOOP_PROGRAM, + os.environ, + file_actions=None + ) + self.assertEqual(os.waitpid(pid, 0), (pid, 0)) + def test_empty_file_actions(self): pid = self.spawn_func( self.NOOP_PROGRAM[0], |