Skip to content

Commit 078fa23

Browse files
committed
Revert "[3.15] pythongh-158540: Add the profiled script's directory to sys.path (pythonGH-158548) (python#158844)"
This reverts commit f52d831.
1 parent 5eb436c commit 078fa23

3 files changed

Lines changed: 0 additions & 122 deletions

File tree

‎Lib/profiling/sampling/_sync_coordinator.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,6 @@ def _execute_script(script_path: str, script_args: List[str], cwd: str) -> None:
168168
if not os.path.isfile(script_path):
169169
raise TargetError(f"Script not found: {script_path}")
170170

171-
script_dir = os.path.dirname(os.path.realpath(script_path))
172-
if script_dir in sys.path:
173-
sys.path.remove(script_dir)
174-
sys.path.insert(0, script_dir)
175-
176171
# Replace sys.argv to match original script call
177172
sys.argv = [script_path] + script_args
178173

‎Lib/test/test_profiling/test_sampling_profiler/test_sync_coordinator.py‎

Lines changed: 0 additions & 113 deletions
This file was deleted.

‎Misc/NEWS.d/next/Library/2026-09-30-22-10-00.gh-issue-158540.kQ9vXm.rst‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)