summaryrefslogtreecommitdiffstats
path: root/Python/peephole.c
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-05-12 02:57:16 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-05-12 02:57:16 (GMT)
commit7544508f0245173bff5866aa1598c8f6cce1fc5f (patch)
treebf80850d9cd46fc811f04b8c2484fb50775c697d /Python/peephole.c
parent4e6bf4b3da03b132b0698f30ee931a350585b117 (diff)
downloadcpython-7544508f0245173bff5866aa1598c8f6cce1fc5f.zip
cpython-7544508f0245173bff5866aa1598c8f6cce1fc5f.tar.gz
cpython-7544508f0245173bff5866aa1598c8f6cce1fc5f.tar.bz2
PEP 0492 -- Coroutines with async and await syntax. Issue #24017.
Diffstat (limited to 'Python/peephole.c')
-rw-r--r--Python/peephole.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/peephole.c b/Python/peephole.c
index 2f8f0e5..59ad3b7 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -319,6 +319,7 @@ markblocks(unsigned char *code, Py_ssize_t len)
case SETUP_EXCEPT:
case SETUP_FINALLY:
case SETUP_WITH:
+ case SETUP_ASYNC_WITH:
j = GETJUMPTGT(code, i);
blocks[j] = 1;
break;
@@ -620,6 +621,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
case SETUP_EXCEPT:
case SETUP_FINALLY:
case SETUP_WITH:
+ case SETUP_ASYNC_WITH:
tgt = GETJUMPTGT(codestr, i);
/* Replace JUMP_* to a RETURN into just a RETURN */
if (UNCONDITIONAL_JUMP(opcode) &&
@@ -704,6 +706,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
case SETUP_EXCEPT:
case SETUP_FINALLY:
case SETUP_WITH:
+ case SETUP_ASYNC_WITH:
j = addrmap[GETARG(codestr, i) + i + 3] - addrmap[i] - 3;
SETARG(codestr, i, j);
break;