Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa4da1e commit 85cf3a9Copy full SHA for 85cf3a9
2 files changed
Lib/site.py
@@ -503,9 +503,14 @@ def register_readline():
503
if PYTHON_BASIC_REPL:
504
CAN_USE_PYREPL = False
505
else:
506
- import _pyrepl.readline
507
- import _pyrepl.unix_console
508
- from _pyrepl.main import CAN_USE_PYREPL
+ original_path = sys.path
+ sys.path = [p for p in original_path if p != '']
+ try:
509
+ import _pyrepl.readline
510
+ import _pyrepl.unix_console
511
+ from _pyrepl.main import CAN_USE_PYREPL
512
+ finally:
513
+ sys.path = original_path
514
except ImportError:
515
return
516
Misc/NEWS.d/next/Security/2024-10-09-20-08-13.gh-issue-125140.YgNWRB.rst
@@ -0,0 +1 @@
1
+Remove the current directory from ``sys.path`` when using PyREPL.
0 commit comments