Skip to content

Commit c2b141e

Browse files
committed
Remove unused code.
1 parent 381f3d3 commit c2b141e

File tree

4 files changed

+1
-60
lines changed

4 files changed

+1
-60
lines changed

Lib/test/test_asyncio/test_tasks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ async def runner():
322322
self.loop.run_until_complete(runner())
323323

324324
def test_task_repr(self):
325-
self.maxDiff = None
326325
self.loop.set_debug(False)
327326

328327
async def notmuch():

Objects/genobject.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,9 +1335,6 @@ compute_cr_origin(int origin_depth, InterpreterFrame *current_frame)
13351335
return NULL;
13361336
}
13371337
frame = current_frame;
1338-
if (frame) {
1339-
1340-
}
13411338
for (int i = 0; i < frame_count; ++i) {
13421339
PyCodeObject *code = frame->f_code;
13431340
PyObject *frameinfo = Py_BuildValue("OiO",

Python/ceval.c

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,49 +1757,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
17571757
#endif
17581758

17591759
DISPATCH();
1760-
check_eval_breaker:
1761-
{
1762-
assert(STACK_LEVEL() >= 0); /* else underflow */
1763-
assert(STACK_LEVEL() <= frame->f_code->co_stacksize); /* else overflow */
1764-
assert(!_PyErr_Occurred(tstate));
1765-
1766-
/* Do periodic things. Doing this every time through
1767-
the loop would add too much overhead, so we do it
1768-
only every Nth instruction. We also do it if
1769-
``pending.calls_to_do'' is set, i.e. when an asynchronous
1770-
event needs attention (e.g. a signal handler or
1771-
async I/O handler); see Py_AddPendingCall() and
1772-
Py_MakePendingCalls() above. */
1773-
1774-
if (_Py_atomic_load_relaxed(eval_breaker)) {
1775-
opcode = _Py_OPCODE(*next_instr);
1776-
if (opcode != BEFORE_ASYNC_WITH &&
1777-
opcode != SEND &&
1778-
_Py_OPCODE(next_instr[-1]) != SEND) {
1779-
/* Few cases where we skip running signal handlers and other
1780-
pending calls:
1781-
- If we're about to enter the 'with:'. It will prevent
1782-
emitting a resource warning in the common idiom
1783-
'with open(path) as file:'.
1784-
- If we're about to enter the 'async with:'.
1785-
- If we're about to enter the 'try:' of a try/finally (not
1786-
*very* useful, but might help in some cases and it's
1787-
traditional)
1788-
- If we're resuming a chain of nested 'yield from' or
1789-
'await' calls, then each frame is parked with YIELD_FROM
1790-
as its next opcode. If the user hit control-C we want to
1791-
wait until we've reached the innermost frame before
1792-
running the signal handler and raising KeyboardInterrupt
1793-
(see bpo-30039).
1794-
*/
1795-
if (eval_frame_handle_pending(tstate) != 0) {
1796-
goto error;
1797-
}
1798-
}
1799-
}
1800-
1801-
DISPATCH();
18021760

1761+
{
18031762
/* Start instructions */
18041763
#if USE_COMPUTED_GOTOS
18051764
{

Python/frame.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,9 @@ _PyFrame_Traverse(InterpreterFrame *frame, visitproc visit, void *arg)
2222
return 0;
2323
}
2424

25-
static int
26-
frame_is_initialized(InterpreterFrame *frame)
27-
{
28-
if (frame->f_lasti < 0) {
29-
return 0;
30-
}
31-
int opcode = _Py_OPCODE(frame->f_code->co_firstinstr[frame->f_lasti]);
32-
if (opcode == MAKE_CELL || opcode == COPY_FREE_VARS) {
33-
return 0;
34-
}
35-
return 1;
36-
}
37-
3825
PyFrameObject *
3926
_PyFrame_MakeAndSetFrameObject(InterpreterFrame *frame)
4027
{
41-
assert(frame_is_initialized(frame));
4228
assert(frame->frame_obj == NULL);
4329
PyObject *error_type, *error_value, *error_traceback;
4430
PyErr_Fetch(&error_type, &error_value, &error_traceback);

0 commit comments

Comments
 (0)