Skip to content

Commit d211658

Browse files
authored
Remove pyenv related code (closes #1078) (#1084)
## Description Removes `pyenv` related functionality from gef.py and documents it. See discussion at #1078
1 parent 429a0e5 commit d211658

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

‎docs/deprecated.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ page aims to track those changes.
1616
| `windbg` | Moved | [a933a5a](https://github.com/hugsy/gef-extras/commit/a933a5ac43933742d91f4e299eadf05e3e0670be) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/windbg.py) | |
1717
| `is-syscall` | Moved | [3f79fb38](https://github.com/hugsy/gef-extras/commit/3f79fb382aa9052d073698d40237f98982c5d2de) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/syscall_args) | |
1818
| `syscall-args` | Moved | [3f79fb38](https://github.com/hugsy/gef-extras/commit/3f79fb382aa9052d073698d40237f98982c5d2de) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/syscall_args) | |
19+
20+
## Removed support for pyenv
21+
22+
Support for [pyenv](https://github.com/pyenv/pyenv) has been removed after `2024.05`, for more
23+
information see [#1078](https://github.com/hugsy/gef/issues/1078) and [#1062](https://github.com/hugsy/gef/issues/1062).

‎gef.py‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11479,16 +11479,6 @@ def target_remote_posthook():
1147911479
f"(with Python {'.'.join(map(str, PYTHON_MIN_VERSION))} or higher).")
1148011480
exit(1)
1148111481

11482-
try:
11483-
pyenv = which("pyenv")
11484-
pyenv_root = gef_pystring(subprocess.check_output([pyenv, "root"]).strip())
11485-
pyenv_version = gef_pystring(subprocess.check_output([pyenv, "version-name"]).strip())
11486-
site_packages_dir = pathlib.Path(pyenv_root) / f"versions/{pyenv_version}/lib/python{pathlib.Path(pyenv_version).stem}/site-packages"
11487-
assert site_packages_dir.is_dir()
11488-
site.addsitedir(str(site_packages_dir.absolute()))
11489-
except FileNotFoundError:
11490-
pass
11491-
1149211482
# When using a Python virtual environment, GDB still loads the system-installed Python
1149311483
# so GEF doesn't load site-packages dir from environment
1149411484
# In order to fix it, from the shell with venv activated we run the python binary,

0 commit comments

Comments
 (0)