Skip to content

Commit

Permalink
chore: remove more 3.7 related code
Browse files Browse the repository at this point in the history
  • Loading branch information
taegyunkim committed Feb 4, 2025
1 parent 3ac7025 commit 6330ce0
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 175 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
build_wheels:
uses: ./.github/workflows/build_python_3.yml
with:
cibw_build: 'cp37* cp38* cp39* cp310* cp311* cp312* cp313*'
cibw_build: 'cp38* cp39* cp310* cp311* cp312* cp313*'

build_sdist:
name: Build source distribution
Expand Down
4 changes: 1 addition & 3 deletions ddtrace/appsec/_python_info/stdlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
from sys import version_info


if version_info < (3, 7, 0):
from .module_names_py36 import STDLIB_MODULE_NAMES
elif version_info < (3, 8, 0):
if version_info < (3, 8, 0):
from .module_names_py37 import STDLIB_MODULE_NAMES
elif version_info < (3, 9, 0):
from .module_names_py38 import STDLIB_MODULE_NAMES
Expand Down
90 changes: 0 additions & 90 deletions ddtrace/internal/wrapping/asyncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,96 +537,6 @@
"""
)

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

ASYNC_GEN_ASSEMBLY.parse(
r"""
setup_except @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_except @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
store_fast $__value
pop_except
load_fast $__value
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
2 changes: 1 addition & 1 deletion ddtrace/internal/wrapping/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
)


elif sys.version_info >= (3, 7):
elif sys.version_info >= (3, 8):
CONTEXT_HEAD.parse(
r"""
load_const {context}
Expand Down
71 changes: 0 additions & 71 deletions ddtrace/internal/wrapping/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,77 +383,6 @@
"""
)


elif PY >= (3, 7):
GENERATOR_ASSEMBLY.parse(
r"""
setup_except @stopiter
dup_top
store_fast $__ddgen
load_attr $send
store_fast $__ddgensend
load_const next
load_fast $__ddgen
loop:
call_function 1
yield:
setup_except @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
store_fast $__value
pop_except
load_fast $__value
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
2 changes: 1 addition & 1 deletion lib-injection/sources/sitecustomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def parse_version(version):
SCRIPT_DIR = os.path.dirname(__file__)
RUNTIMES_ALLOW_LIST = {
"cpython": {
"min": Version(version=(3, 7), constraint=""),
"min": Version(version=(3, 8), constraint=""),
"max": Version(version=(3, 13), constraint=""),
}
}
Expand Down
8 changes: 0 additions & 8 deletions tests/integration/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@ def test_standard_tags():
in_venv = f.get("in_virtual_env")
assert in_venv is True

lang_version = f.get("lang_version")
if sys.version_info == (3, 7, 0):
assert "3.7" in lang_version
elif sys.version_info == (3, 6, 0):
assert "3.6" in lang_version
elif sys.version_info == (2, 7, 0):
assert "2.7" in lang_version

agent_url = f.get("agent_url")
assert agent_url == "http://localhost:8126"

Expand Down

0 comments on commit 6330ce0

Please sign in to comment.