Skip to content

Commit

Permalink
Add notice for PyPy users (#829)
Browse files Browse the repository at this point in the history
(DIS-3295)
  • Loading branch information
cecinestpasunepipe authored Aug 26, 2024
1 parent 3822b47 commit 6968253
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions dissect/target/tools/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import logging
import os
import pathlib
import platform
import pydoc
import random
import re
Expand Down Expand Up @@ -1442,6 +1443,20 @@ def main() -> None:
if args.quiet:
logging.getLogger("dissect").setLevel(level=logging.ERROR)

# PyPy < 3.10.14 readline is stuck in Python 2.7
if platform.python_implementation() == "PyPy":
major, minor, patch = tuple(map(int, platform.python_version_tuple()))
if major <= 3 and minor <= 10 and patch < 14:
print(
"\n".join(
[
"Note for users of PyPy < 3.10.14:",
"Autocomplete might not work due to an outdated version of pyrepl/readline.py",
"To fix this, please update your version of PyPy.",
]
)
)

try:
open_shell(args.targets, args.python, args.registry)
except TargetError as e:
Expand Down

0 comments on commit 6968253

Please sign in to comment.