Skip to content

Commit 67bfc69

Browse files
authored
chore(debugging): remove EL support for CPython 3.8 (#15316)
## Description We clean up the expression language implementation by removing support for CPython 3.8.
1 parent 4c58d2f commit 67bfc69

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ddtrace/debugging/_expressions.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ def _is_identifier(name: str) -> bool:
6060
return isinstance(name, str) and name.isidentifier()
6161

6262

63-
IN_OPERATOR_INSTR = Instr("COMPARE_OP", Compare.IN) if PY < (3, 9) else Instr("CONTAINS_OP", 0)
64-
NOT_IN_OPERATOR_INSTR = Instr("COMPARE_OP", Compare.NOT_IN) if PY < (3, 9) else Instr("CONTAINS_OP", 1)
65-
66-
6763
def short_circuit_instrs(op: str, label: Label) -> List[Instr]:
6864
value = "FALSE" if op == "and" else "TRUE"
6965
if PY >= (3, 13):
@@ -156,7 +152,7 @@ def _compile_direct_predicate(self, ast: DDASTType) -> Optional[List[Instr]]:
156152

157153
if _type == "isDefined":
158154
value.append(Instr("LOAD_FAST", "_locals"))
159-
value.append(IN_OPERATOR_INSTR)
155+
value.append(Instr("CONTAINS_OP", 0))
160156
else:
161157
if PY >= (3, 13):
162158
# UNARY_NOT requires a boolean value
@@ -201,7 +197,7 @@ def _compile_arg_predicate(self, ast: DDASTType) -> Optional[List[Instr]]:
201197
raise ValueError("Invalid argument: %r" % a)
202198
if cb is None:
203199
raise ValueError("Invalid argument: %r" % b)
204-
return cb + ca + [IN_OPERATOR_INSTR]
200+
return cb + ca + [Instr("CONTAINS_OP", 0)]
205201

206202
if _type in {"any", "all"}:
207203
a, b = args

0 commit comments

Comments
 (0)