Skip to content

Commit a7a1e19

Browse files
flags: remove reliance on removed opcode
1 parent 943bca6 commit a7a1e19

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/bytecode/flags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import bytecode as _bytecode
77

88
from .instr import DUAL_ARG_OPCODES, CellVar, FreeVar
9-
from .utils import PY311, PY312, PY313
9+
from .utils import PY311, PY312, PY313, PY314
1010

1111

1212
class CompilerFlags(IntFlag):
@@ -48,7 +48,7 @@ class CompilerFlags(IntFlag):
4848
_opcode.opmap["GET_AWAITABLE"],
4949
_opcode.opmap["GET_AITER"],
5050
_opcode.opmap["GET_ANEXT"],
51-
_opcode.opmap["BEFORE_ASYNC_WITH"],
51+
*((_opcode.opmap["BEFORE_ASYNC_WITH"],) if not PY314 else ()), # Removed in 3.14+
5252
*((_opcode.opmap["SETUP_ASYNC_WITH"],) if not PY311 else ()), # Removed in 3.11+
5353
_opcode.opmap["END_ASYNC_FOR"],
5454
*((_opcode.opmap["ASYNC_GEN_WRAP"],) if PY311 and not PY312 else ()), # New in 3.11

0 commit comments

Comments
 (0)