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

Skip to content

Commit 42a5514

Browse files
Revert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)" (GH-27194) (#27195)
This reverts commit 000e70a. (cherry picked from commit c90c591) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
1 parent 93d36a5 commit 42a5514

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
@@ -3759,17 +3759,14 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
37593759
if (Py_IsFalse(cond)) {
37603760
Py_DECREF(cond);
37613761
JUMPTO(oparg);
3762-
CHECK_EVAL_BREAKER();
37633762
DISPATCH();
37643763
}
37653764
err = PyObject_IsTrue(cond);
37663765
Py_DECREF(cond);
37673766
if (err > 0)
37683767
;
3769-
else if (err == 0) {
3768+
else if (err == 0)
37703769
JUMPTO(oparg);
3771-
CHECK_EVAL_BREAKER();
3772-
}
37733770
else
37743771
goto error;
37753772
DISPATCH();
@@ -3786,14 +3783,12 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
37863783
if (Py_IsTrue(cond)) {
37873784
Py_DECREF(cond);
37883785
JUMPTO(oparg);
3789-
CHECK_EVAL_BREAKER();
37903786
DISPATCH();
37913787
}
37923788
err = PyObject_IsTrue(cond);
37933789
Py_DECREF(cond);
37943790
if (err > 0) {
37953791
JUMPTO(oparg);
3796-
CHECK_EVAL_BREAKER();
37973792
}
37983793
else if (err == 0)
37993794
;

0 commit comments

Comments
 (0)
0