josiahcarlson / mprop

Module properties for Python
GNU Lesser General Public License v2.1
24 stars 0 forks source link

cprofile crash with mprop #4

Closed haolongzhangm closed 1 year ago

haolongzhangm commented 2 years ago

just write simple 3.py

import mprop from mprop import mproperty

@mproperty def test_aa(): printf("hhhh")

///////////////////////////////////////

then run command: python3 -m cProfile 3.py

will crash log:

Traceback (most recent call last): File "/home/zhl/.pyenv/versions/3.8.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/zhl/.pyenv/versions/3.8.8/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/zhl/.pyenv/versions/3.8.8/lib/python3.8/cProfile.py", line 206, in main() File "/home/zhl/.pyenv/versions/3.8.8/lib/python3.8/cProfile.py", line 195, in main runctx(code, globs, None, options.outfile, options.sort) File "/home/zhl/.pyenv/versions/3.8.8/lib/python3.8/cProfile.py", line 19, in runctx return _pyprofile._Utils(Profile).runctx(statement, globals, locals, File "/home/zhl/.pyenv/versions/3.8.8/lib/python3.8/profile.py", line 62, in runctx prof.runctx(statement, globals, locals) File "/home/zhl/.pyenv/versions/3.8.8/lib/python3.8/cProfile.py", line 100, in runctx exec(cmd, globals, locals) File "/home/zhl/.pyenv/versions/3.8.8/lib/python3.8/cProfile.py", line 100, in runctx exec(cmd, globals, locals) TypeError: 'Profile' object is not callable

haolongzhangm commented 2 years ago

issue sames mprop handle sys profiler

josiahcarlson commented 1 year ago

Have you considered using a modern Python and not using my hack (this package)? I use the system debugger/tracing to do this, and it isn't compatible with profiling (which uses the same system).

On Thu, Jun 23, 2022, 6:19 AM haolongzhangm @.***> wrote:

issue sames mprop handle sys profiler

— Reply to this email directly, view it on GitHub https://github.com/josiahcarlson/mprop/issues/4#issuecomment-1164285262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABTDQRMW54DGMOFAGVLWW3VQRB2XANCNFSM5ZT7KOVQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>