Skip to content

Commit 0724124

Browse files
authored
chore: drop 3.8 support in bytecode instrumentation (#15314)
## Description We clean up sources by removing CPython 3.8 support from bytecode instrumentation.
1 parent 53726a1 commit 0724124

File tree

3 files changed

+0
-188
lines changed

3 files changed

+0
-188
lines changed

ddtrace/internal/wrapping/asyncs.py

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -705,94 +705,6 @@
705705
"""
706706
)
707707

708-
elif PY >= (3, 8):
709-
COROUTINE_ASSEMBLY.parse(
710-
r"""
711-
get_awaitable
712-
load_const None
713-
yield_from
714-
"""
715-
)
716-
717-
ASYNC_GEN_ASSEMBLY.parse(
718-
r"""
719-
setup_finally @stopiter
720-
dup_top
721-
store_fast $__ddgen
722-
load_attr $asend
723-
store_fast $__ddgensend
724-
load_fast $__ddgen
725-
load_attr $__anext__
726-
call_function 0
727-
728-
loop:
729-
get_awaitable
730-
load_const None
731-
yield_from
732-
733-
yield:
734-
setup_finally @genexit
735-
yield_value
736-
pop_block
737-
load_fast $__ddgensend
738-
rot_two
739-
call_function 1
740-
jump_absolute @loop
741-
742-
genexit:
743-
dup_top
744-
load_const GeneratorExit
745-
compare_op asm.Compare.EXC_MATCH
746-
pop_jump_if_false @exc
747-
pop_top
748-
pop_top
749-
pop_top
750-
pop_top
751-
load_fast $__ddgen
752-
load_attr $aclose
753-
call_function 0
754-
get_awaitable
755-
load_const None
756-
yield_from
757-
pop_except
758-
return_value
759-
760-
exc:
761-
pop_top
762-
pop_top
763-
pop_top
764-
pop_top
765-
load_fast $__ddgen
766-
load_attr $athrow
767-
load_const sys.exc_info
768-
call_function 0
769-
call_function_ex 0
770-
get_awaitable
771-
load_const None
772-
yield_from
773-
rot_four
774-
pop_except
775-
jump_absolute @yield
776-
777-
stopiter:
778-
dup_top
779-
load_const StopAsyncIteration
780-
compare_op asm.Compare.EXC_MATCH
781-
pop_jump_if_false @propagate
782-
pop_top
783-
pop_top
784-
pop_top
785-
pop_except
786-
load_const None
787-
return_value
788-
789-
propagate:
790-
end_finally
791-
load_const None
792-
return_value
793-
"""
794-
)
795-
796708
else:
797709
msg = "No async wrapping support for Python %d.%d" % PY[:2]
798710
raise RuntimeError(msg)

ddtrace/internal/wrapping/context.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -283,37 +283,6 @@
283283
)
284284

285285

286-
elif sys.version_info >= (3, 8):
287-
CONTEXT_HEAD.parse(
288-
r"""
289-
load_const {context}
290-
setup_with @_except
291-
pop_top
292-
_except:
293-
"""
294-
)
295-
296-
CONTEXT_RETURN.parse(
297-
r"""
298-
load_const {context}
299-
load_method $__return__
300-
rot_three
301-
rot_three
302-
call_method 1
303-
"""
304-
)
305-
306-
CONTEXT_FOOT.parse(
307-
r"""
308-
with_cleanup_start
309-
with_cleanup_finish
310-
end_finally
311-
load_const None
312-
return_value
313-
"""
314-
)
315-
316-
317286
# This is abstract and should not be used directly
318287
class BaseWrappingContext(ABC):
319288
__priority__: int = 0

ddtrace/internal/wrapping/generators.py

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -476,75 +476,6 @@
476476
"""
477477
)
478478

479-
elif PY >= (3, 8):
480-
GENERATOR_ASSEMBLY.parse(
481-
r"""
482-
setup_finally @stopiter
483-
dup_top
484-
store_fast $__ddgen
485-
load_attr $send
486-
store_fast $__ddgensend
487-
load_const next
488-
load_fast $__ddgen
489-
490-
loop:
491-
call_function 1
492-
493-
yield:
494-
setup_finally @genexit
495-
yield_value
496-
pop_block
497-
load_fast $__ddgensend
498-
rot_two
499-
jump_absolute @loop
500-
501-
genexit:
502-
dup_top
503-
load_const GeneratorExit
504-
compare_op asm.Compare.EXC_MATCH
505-
pop_jump_if_false @exc
506-
pop_top
507-
pop_top
508-
pop_top
509-
pop_top
510-
load_fast $__ddgen
511-
load_attr $close
512-
call_function 0
513-
return_value
514-
515-
exc:
516-
pop_top
517-
pop_top
518-
pop_top
519-
pop_top
520-
load_fast $__ddgen
521-
load_attr $throw
522-
load_const sys.exc_info
523-
call_function 0
524-
call_function_ex 0
525-
rot_four
526-
pop_except
527-
jump_absolute @yield
528-
529-
stopiter:
530-
dup_top
531-
load_const StopIteration
532-
compare_op asm.Compare.EXC_MATCH
533-
pop_jump_if_false @propagate
534-
pop_top
535-
pop_top
536-
pop_top
537-
pop_except
538-
load_const None
539-
return_value
540-
541-
propagate:
542-
end_finally
543-
load_const None
544-
return_value
545-
"""
546-
)
547-
548479
else:
549480
msg = "No generator wrapping support for Python %d.%d" % PY[:2]
550481
raise RuntimeError(msg)

0 commit comments

Comments
 (0)