https://github.com/python/cpython/commit/3e36d375352632be85b9ac3a0eeb075a4e03ef6f
commit: 3e36d375352632be85b9ac3a0eeb075a4e03ef6f
branch: main
author: Savannah Ostrowski <[email protected]>
committer: pablogsal <[email protected]>
date: 2025-12-13T05:20:28Z
summary:
GH-142646: Update Tachyon to use backtick formatting in CLI help (#142647)
files:
M Lib/profiling/sampling/cli.py
diff --git a/Lib/profiling/sampling/cli.py b/Lib/profiling/sampling/cli.py
index 3a0444db4c3636..2bb4f31efe17be 100644
--- a/Lib/profiling/sampling/cli.py
+++ b/Lib/profiling/sampling/cli.py
@@ -41,24 +41,20 @@ class CustomFormatter(
_HELP_DESCRIPTION = """Sample a process's stack frames and generate profiling
data.
-Commands:
- run Run and profile a script or module
- attach Attach to and profile a running process
-
Examples:
# Run and profile a script
- python -m profiling.sampling run script.py arg1 arg2
+ `python -m profiling.sampling run script.py arg1 arg2`
# Attach to a running process
- python -m profiling.sampling attach 1234
+ `python -m profiling.sampling attach 1234`
# Live interactive mode for a script
- python -m profiling.sampling run --live script.py
+ `python -m profiling.sampling run --live script.py`
# Live interactive mode for a running process
- python -m profiling.sampling attach --live 1234
+ `python -m profiling.sampling attach --live 1234`
-Use 'python -m profiling.sampling <command> --help' for command-specific
help."""
+Use `python -m profiling.sampling <command> --help` for command-specific
help."""
# Constants for socket synchronization
@@ -506,19 +502,19 @@ def main():
Examples:
# Run and profile a module
- python -m profiling.sampling run -m mymodule arg1 arg2
+ `python -m profiling.sampling run -m mymodule arg1 arg2`
# Generate flamegraph from a script
- python -m profiling.sampling run --flamegraph -o output.html script.py
+ `python -m profiling.sampling run --flamegraph -o output.html script.py`
# Profile with custom interval and duration
- python -m profiling.sampling run -i 50 -d 30 script.py
+ `python -m profiling.sampling run -i 50 -d 30 script.py`
# Save collapsed stacks to file
- python -m profiling.sampling run --collapsed -o stacks.txt script.py
+ `python -m profiling.sampling run --collapsed -o stacks.txt script.py`
# Live interactive mode for a script
- python -m profiling.sampling run --live script.py""",
+ `python -m profiling.sampling run --live script.py`""",
)
run_parser.add_argument(
"-m",
@@ -554,10 +550,10 @@ def main():
Examples:
# Profile all threads, sort by total time
- python -m profiling.sampling attach -a --sort tottime 1234
+ `python -m profiling.sampling attach -a --sort tottime 1234`
# Live interactive mode for a running process
- python -m profiling.sampling attach --live 1234""",
+ `python -m profiling.sampling attach --live 1234`""",
)
attach_parser.add_argument(
"pid",
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]