Skip to content

gh-140729: Fix the cProfile module when the executed script contains calls to multiprocessing.Process#144700

Closed
YvesDup wants to merge 2 commits intopython:mainfrom
YvesDup:cprofile-module-multiprocessing
Closed

gh-140729: Fix the cProfile module when the executed script contains calls to multiprocessing.Process#144700
YvesDup wants to merge 2 commits intopython:mainfrom
YvesDup:cprofile-module-multiprocessing

Conversation

@YvesDup
Copy link
Contributor

@YvesDup YvesDup commented Feb 11, 2026

When profilng the ttt.py script via cProfile module ,

import multiprocessing

def worker_proc(x):
    return x ** 99

def main_proc():
    p = multiprocessing.Process(target=worker_proc, args=(10,))
    p.start()
    p.join()

if __name__ == "__main__":
    main_proc()
./python.exe -m cProfile ttt.py 

an error occurs:

AttributeError: module '__main__' has no attribute 'worker_proc'

This fix does not apply to the profile module, which is deprecated and will be removed in python 3.17.

@YvesDup
Copy link
Contributor Author

YvesDup commented Feb 11, 2026

closed, because complex conflicts. A new PR will be submit soon

@YvesDup YvesDup closed this Feb 11, 2026
@YvesDup YvesDup deleted the cprofile-module-multiprocessing branch February 11, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant