MCPcopy Index your code
hub / github.com/python/cpython / curses_wrapper_func

Function curses_wrapper_func

Lib/profiling/sampling/sample.py:502–519  ·  view source on GitHub ↗
(stdscr)

Source from the content-addressed store, hash-verified

500 profiler.realtime_stats = realtime_stats
501
502 def curses_wrapper_func(stdscr):
503 collector.init_curses(stdscr)
504 try:
505 profiler.sample(collector, duration_sec, async_aware=async_aware)
506 # If too few samples were collected, exit cleanly without showing TUI
507 if collector.successful_samples < MIN_SAMPLES_FOR_TUI:
508 # Clear screen before exiting to avoid visual artifacts
509 stdscr.clear()
510 stdscr.refresh()
511 return
512 # Mark as finished and keep the TUI running until user presses 'q'
513 collector.mark_finished()
514 # Keep processing input until user quits
515 while collector.running:
516 collector._handle_input()
517 time.sleep(0.05) # Small sleep to avoid busy waiting
518 finally:
519 collector.cleanup_curses()
520
521 try:
522 curses.wrapper(curses_wrapper_func)

Callers

nothing calls this directly

Calls 8

init_cursesMethod · 0.80
mark_finishedMethod · 0.80
_handle_inputMethod · 0.80
cleanup_cursesMethod · 0.80
sampleMethod · 0.45
clearMethod · 0.45
refreshMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…