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 into
python: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 into
python:mainfrom
YvesDup:cprofile-module-multiprocessing

Conversation

@YvesDup

@YvesDupYvesDup commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

When profilng the ttt.py script via cProfile module ,

importmultiprocessingdefworker_proc(x):
returnx**99defmain_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

YvesDup commented Feb 11, 2026

Copy link
Copy Markdown
ContributorAuthor

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

@YvesDupYvesDup closed this Feb 11, 2026
@YvesDup
YvesDup deleted the cprofile-module-multiprocessing branch February 11, 2026 09:34
Sign up for freeto 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

@YvesDup