Skip to content

Commit 994e7e9

Browse files
committed
remove uop optimize tests
1 parent 1eb33e1 commit 994e7e9

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def get_opnames(ex):
5656

5757
@requires_specialization
5858
@unittest.skipIf(Py_GIL_DISABLED, "optimizer not yet supported in free-threaded builds")
59-
@unittest.skipUnless(hasattr(_testinternalcapi, "get_optimizer"),
59+
@unittest.skipUnless(hasattr(_testinternalcapi, "get_optimizer") and
60+
hasattr(_testinternalcapi, "new_uop_optimizer"),
6061
"Requires optimizer infrastructure")
6162
@unittest.skipIf(os.getenv("PYTHON_UOPS_OPTIMIZE") == "0", "Needs uop optimizer to run.")
6263
class TestUops(unittest.TestCase):
@@ -424,7 +425,8 @@ def testfunc(n):
424425

425426
@requires_specialization
426427
@unittest.skipIf(Py_GIL_DISABLED, "optimizer not yet supported in free-threaded builds")
427-
@unittest.skipUnless(hasattr(_testinternalcapi, "get_optimizer"),
428+
@unittest.skipUnless(hasattr(_testinternalcapi, "get_optimizer") and
429+
hasattr(_testinternalcapi, "new_uop_optimizer"),
428430
"Requires optimizer infrastructure")
429431
@unittest.skipIf(os.getenv("PYTHON_UOPS_OPTIMIZE") == "0", "Needs uop optimizer to run.")
430432
class TestUopsOptimization(unittest.TestCase):

Modules/_testinternalcapi.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -989,12 +989,6 @@ get_co_framesize(PyObject *self, PyObject *arg)
989989

990990
#ifdef _Py_TIER2
991991

992-
static PyObject *
993-
new_uop_optimizer(PyObject *self, PyObject *arg)
994-
{
995-
return _PyOptimizer_NewUOpOptimizer();
996-
}
997-
998992
static PyObject *
999993
set_optimizer(PyObject *self, PyObject *opt)
1000994
{
@@ -2106,7 +2100,6 @@ static PyMethodDef module_functions[] = {
21062100
#ifdef _Py_TIER2
21072101
{"get_optimizer", get_optimizer, METH_NOARGS, NULL},
21082102
{"set_optimizer", set_optimizer, METH_O, NULL},
2109-
{"new_uop_optimizer", new_uop_optimizer, METH_NOARGS, NULL},
21102103
{"add_executor_dependency", add_executor_dependency, METH_VARARGS, NULL},
21112104
{"invalidate_executors", invalidate_executors, METH_O, NULL},
21122105
#endif

0 commit comments

Comments
 (0)