mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
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)
This commit is contained in:
parent
aa3ea7ee78
commit
91f01e175a
2 changed files with 4 additions and 3 deletions
|
|
@ -461,12 +461,11 @@ class ProcessSerialNumber(Structure):
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -113,6 +113,8 @@ Tests
|
|||
- 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
|
||||
-----
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue