mirror of
https://github.com/python/cpython.git
synced 2026-05-04 09:31:02 +00:00
GH-148932: Improve error message if profiling.sampling run from venv on Windows platform (#149247)
This commit is contained in:
parent
b89735625d
commit
fea2a57282
1 changed files with 4 additions and 0 deletions
|
|
@ -58,6 +58,10 @@ def __init__(self, pid, sample_interval_usec, all_threads, *, mode=PROFILING_MOD
|
|||
try:
|
||||
self.unwinder = self._new_unwinder(native, gc, opcodes, skip_non_matching_threads)
|
||||
except RuntimeError as err:
|
||||
if os.name == "nt" and sys.executable.endswith("python.exe"):
|
||||
raise SystemExit(
|
||||
"Running profiling.sampling from virtualenv on Windows platform is not supported"
|
||||
) from err
|
||||
raise SystemExit(err) from err
|
||||
# Track sample intervals and total sample count
|
||||
self.sample_intervals = deque(maxlen=100)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue