8000 Revert "bpo-44645: Check for interrupts on any potentially backwards … · python/cpython@c90c591 · GitHub
[go: up one dir, main page]

Skip to content

Commit c90c591

Browse files
authored
Revert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)" (#27194)
This reverts commit 000e70a.
1 parent e9cd47d commit c90c591

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

Lib/test/test_threading.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,31 +1604,6 @@ def test_interrupt_main_invalid_signal(self):
16041604
self.assertRaises(ValueError, _thread.interrupt_main, signal.NSIG)
16051605
self.assertRaises(ValueError, _thread.interrupt_main, 1000000)
16061606

1607-
@threading_helper.reap_threads
1608-
def test_can_interrupt_tight_loops(self):
1609-
cont = True
1610-
started = False
1611-
iterations = 100_000_000
1612-
1613-
def worker():
1614-
nonlocal iterations
1615-
nonlocal started
1616-
started = True
1617-
while cont:
1618-
if iterations:
1619-
iterations -= 1
1620-
else:
1621-
return
1622-
pass
1623-
1624-
t = threading.Thread(target=worker)
1625-
t.start()
1626-
while not started:
1627-
pass
1628-
cont = False
1629-
t.join()
1630-
self.assertNotEqual(iterations, 0)
1631-
16321607

16331608
class AtexitTests(unittest.TestCase):
16341609

Python/ceval.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3638,17 +3638,14 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
36383638
if (Py_IsFalse(cond)) {
36393639
Py_DECREF(cond);
36403640
JUMPTO(oparg);
3641-
CHECK_EVAL_BREAKER();
36423641
DISPATCH();
36433642
}
36443643
err = PyObject_IsTrue(cond);
36453644
Py_DECREF(cond);
36463645
if (err > 0)
36473646
;
3648-
else if (err == 0) {
3647+
else if (err == 0)
36493648
JUMPTO(oparg);
3650-
CHECK_EVAL_BREAKER();
3651-
}
36523649
else
36533650
goto error;
36543651
DISPATCH();
@@ -3665,14 +3662,12 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
36653662
if (Py_IsTrue(cond)) {
36663663
Py_DECREF(cond);
36673664
JUMPTO(oparg);
3668-
CHECK_EVAL_BREAKER();
36693665
DISPATCH();
36703666
}
36713667
err = PyObject_IsTrue(cond);
36723668
Py_DECREF(cond);
36733669
if (err > 0) {
36743670
JUMPTO(oparg);
3675-
CHECK_EVAL_BREAKER();
36763671
}
36773672
else if (err == 0)
36783673
;

0 commit comments

Comments
 (0)
0