diff options
Diffstat (limited to 'Lib/test/test_platform.py')
-rw-r--r-- | Lib/test/test_platform.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index ba3af1a58d..04f1a6a5fb 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -194,6 +194,25 @@ class PlatformTest(unittest.TestCase): else: self.assertEquals(res[2], 'PowerPC') + + @unittest.skipUnless(sys.platform == 'darwin', "OSX only test") + def test_mac_ver_with_fork(self): + # Issue7895: platform.mac_ver() crashes when using fork without exec + # + # This test checks that the fix for that issue works. + # + pid = os.fork() + if pid == 0: + # child + info = platform.mac_ver() + os._exit(0) + + else: + # parent + cpid, sts = os.waitpid(pid, 0) + self.assertEquals(cpid, pid) + self.assertEquals(sts, 0) + def test_dist(self): res = platform.dist() |