Files
Timur Malaninandintellij-monorepo-bot 9262964625 PY-86308: Fix profiler module execution with -m flag
Problem:
- Profiling with -m flag failed to find modules in Python 3.12+
- pkgutil.get_loader() was deprecated in Python 3.3 and removed in Python 3.12
- Module arguments (e.g., -e, --mode) were incorrectly parsed as profiler arguments

Solution:
1. Updated get_fullname() in prof_util.py:
   - Use importlib.util.find_spec() for Python 3.x (modern API)
   - Keep pkgutil.get_loader() only for Python 2.7 (legacy support)

2. Fixed argument parsing in run_profiler.py:
   - When -m is specified, all remaining args are passed to the target module
   - Avoid double-parsing that caused "unrecognized arguments" errors

Space-RevId: 86889a34e12bd9cdc510eb5fce739ce96e870789

GitOrigin-RevId: f9b609ff9a36ad6ec02476507892e2b263322930
2026-01-22 17:45:14 +00:00
..