Skip to content

Commit a77915c

Browse files
committed
remove uop optimize tests
1 parent a5bd3f1 commit a77915c

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
@@ -141,7 +141,8 @@ def get_opnames(ex):
141141

142142
@requires_specialization
143143
@unittest.skipIf(Py_GIL_DISABLED, "optimizer not yet supported in free-threaded builds")
144-
@unittest.skipUnless(hasattr(_testinternalcapi, "get_optimizer"),
144+
@unittest.skipUnless(hasattr(_testinternalcapi, "get_optimizer") and
145+
hasattr(_testinternalcapi, "new_uop_optimizer"),
145146
"Requires optimizer infrastructure")
146147
class TestExecutorInvalidation(unittest.TestCase):
147148

@@ -589,7 +590,8 @@ def testfunc(n):
589590

590591
@requires_specialization
591592
@unittest.skipIf(Py_GIL_DISABLED, "optimizer not yet supported in free-threaded builds")
592-
@unittest.skipUnless(hasattr(_testinternalcapi, "get_optimizer"),
593+
@unittest.skipUnless(hasattr(_testinternalcapi, "get_optimizer") and
594+
hasattr(_testinternalcapi, "new_uop_optimizer"),
593595
"Requires optimizer infrastructure")
594596
@unittest.skipIf(os.getenv("PYTHON_UOPS_OPTIMIZE") == "0", "Needs uop optimizer to run.")
595597
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
{
@@ -2095,7 +2089,6 @@ static PyMethodDef module_functions[] = {
20952089
#ifdef _Py_TIER2
20962090
{"get_optimizer", get_optimizer, METH_NOARGS, NULL},
20972091
{"set_optimizer", set_optimizer, METH_O, NULL},
2098-
{"new_uop_optimizer", new_uop_optimizer, METH_NOARGS, NULL},
20992092
{"add_executor_dependency", add_executor_dependency, METH_VARARGS, NULL},
21002093
{"invalidate_executors", invalidate_executors, METH_O, NULL},
21012094
#endif

0 commit comments

Comments
 (0)