changeset: 93343:121517deb318 branch: 3.4 parent: 93339:f7ed3e058fca user: Ned Deily date: Sat Nov 01 19:29:22 2014 -0700 files: Lib/test/support/__init__.py Misc/NEWS description: Issue #22770: Prevent some Tk segfaults on OS X when running gui tests. When running tests in subprocesses with the regrtest -j option, a bug in Cocoa Tk can result in a Tcl segfault. Avoid the problem by forcing Tk to fully initialize as an OS X gui process before destroying the Tcl instance and creating another. (Original patch by Serhiy Storchaka) diff -r f7ed3e058fca -r 121517deb318 Lib/test/support/__init__.py --- a/Lib/test/support/__init__.py Sat Nov 01 17:11:08 2014 -0500 +++ b/Lib/test/support/__init__.py Sat Nov 01 19:29:22 2014 -0700 @@ -461,12 +461,11 @@ reason = "cannot run without OS X gui process" # check on every platform whether tkinter can actually do anything - # but skip the test on OS X because it can cause segfaults in Cocoa Tk - # when running regrtest with the -j option (multiple threads/subprocesses) - if (not reason) and (sys.platform != 'darwin'): + if not reason: try: from tkinter import Tk root = Tk() + root.update() root.destroy() except Exception as e: err_string = str(e) diff -r f7ed3e058fca -r 121517deb318 Misc/NEWS --- a/Misc/NEWS Sat Nov 01 17:11:08 2014 -0500 +++ b/Misc/NEWS Sat Nov 01 19:29:22 2014 -0700 @@ -113,6 +113,8 @@ - Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not present. Patch by Remi Pointel. +- Issue #22770: Prevent some Tk segfaults on OS X when running gui tests. + Build -----