Skip to content

Commit b3b6fff

Browse files
Fix file does not exist
1 parent 880a790 commit b3b6fff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/profiling/sampling/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,10 @@ def _handle_attach(args):
614614

615615
def _handle_run(args):
616616
"""Handle the 'run' command."""
617+
# Validate script exists (only for scripts, not modules)
618+
if not args.module and not os.path.exists(args.target):
619+
sys.exit(f"Error: script not found: {args.target}")
620+
617621
# Check if live mode is requested
618622
if args.live:
619623
_handle_live_run(args)

0 commit comments

Comments
 (0)