Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions ddtrace/internal/wrapping/asyncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,94 +579,6 @@
"""
)

elif PY >= (3, 8):
COROUTINE_ASSEMBLY.parse(
r"""
get_awaitable
load_const None
yield_from
"""
)

ASYNC_GEN_ASSEMBLY.parse(
r"""
setup_finally @stopiter
dup_top
store_fast $__ddgen
load_attr $asend
store_fast $__ddgensend
load_fast $__ddgen
load_attr $__anext__
call_function 0

loop:
get_awaitable
load_const None
yield_from

yield:
setup_finally @genexit
yield_value
pop_block
load_fast $__ddgensend
rot_two
call_function 1
jump_absolute @loop

genexit:
dup_top
load_const GeneratorExit
compare_op asm.Compare.EXC_MATCH
pop_jump_if_false @exc
pop_top
pop_top
pop_top
pop_top
load_fast $__ddgen
load_attr $aclose
call_function 0
get_awaitable
load_const None
yield_from
pop_except
return_value

exc:
pop_top
pop_top
pop_top
pop_top
load_fast $__ddgen
load_attr $athrow
load_const sys.exc_info
call_function 0
call_function_ex 0
get_awaitable
load_const None
yield_from
rot_four
pop_except
jump_absolute @yield

stopiter:
dup_top
load_const StopAsyncIteration
compare_op asm.Compare.EXC_MATCH
pop_jump_if_false @propagate
pop_top
pop_top
pop_top
pop_except
load_const None
return_value

propagate:
end_finally
load_const None
return_value
"""
)

else:
msg = "No async wrapping support for Python %d.%d" % PY[:2]
raise RuntimeError(msg)
Expand Down
31 changes: 0 additions & 31 deletions ddtrace/internal/wrapping/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,37 +283,6 @@
)


elif sys.version_info >= (3, 8):
CONTEXT_HEAD.parse(
r"""
load_const {context}
setup_with @_except
pop_top
_except:
"""
)

CONTEXT_RETURN.parse(
r"""
load_const {context}
load_method $__return__
rot_three
rot_three
call_method 1
"""
)

CONTEXT_FOOT.parse(
r"""
with_cleanup_start
with_cleanup_finish
end_finally
load_const None
return_value
"""
)


# This is abstract and should not be used directly
class BaseWrappingContext(ABC):
__priority__: int = 0
Expand Down
69 changes: 0 additions & 69 deletions ddtrace/internal/wrapping/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,75 +396,6 @@
"""
)

elif PY >= (3, 8):
GENERATOR_ASSEMBLY.parse(
r"""
setup_finally @stopiter
dup_top
store_fast $__ddgen
load_attr $send
store_fast $__ddgensend
load_const next
load_fast $__ddgen

loop:
call_function 1

yield:
setup_finally @genexit
yield_value
pop_block
load_fast $__ddgensend
rot_two
jump_absolute @loop

genexit:
dup_top
load_const GeneratorExit
compare_op asm.Compare.EXC_MATCH
pop_jump_if_false @exc
pop_top
pop_top
pop_top
pop_top
load_fast $__ddgen
load_attr $close
call_function 0
return_value

exc:
pop_top
pop_top
pop_top
pop_top
load_fast $__ddgen
load_attr $throw
load_const sys.exc_info
call_function 0
call_function_ex 0
rot_four
pop_except
jump_absolute @yield

stopiter:
dup_top
load_const StopIteration
compare_op asm.Compare.EXC_MATCH
pop_jump_if_false @propagate
pop_top
pop_top
pop_top
pop_except
load_const None
return_value

propagate:
end_finally
load_const None
return_value
"""
)

else:
msg = "No generator wrapping support for Python %d.%d" % PY[:2]
raise RuntimeError(msg)
Expand Down
Loading