Skip to content

Commit 7f04a15

Browse files
[3.12] gh-105077: Fix test_tkinter refleak checking (GH-105078) (GH-105079)
Use specific symbols from `test.support` to avoid having `support` overwritten by `test_tkinter`'s own `support` submodule. (cherry picked from commit 5454db4)
1 parent 6794526 commit 7f04a15

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Lib/test/test_tkinter/__init__.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import os.path
22
import unittest
3-
from test import support
4-
from test.support import import_helper
53

4+
from test.support import (
5+
check_sanitizer,
6+
import_helper,
7+
load_package_tests,
8+
requires,
9+
)
610

7-
if support.check_sanitizer(address=True, memory=True):
11+
12+
if check_sanitizer(address=True, memory=True):
813
raise unittest.SkipTest("Tests involving libX11 can SEGFAULT on ASAN/MSAN builds")
914

1015
# Skip test if _tkinter wasn't built.
1116
import_helper.import_module('_tkinter')
1217

1318
# Skip test if tk cannot be initialized.
14-
support.requires('gui')
19+
requires('gui')
1520

1621

1722
def load_tests(*args):
18-
return support.load_package_tests(os.path.dirname(__file__), *args)
23+
return load_package_tests(os.path.dirname(__file__), *args)

0 commit comments

Comments
 (0)