python-flamegraph
python-flamegraph copied to clipboard
Python 3.8 support
I'm getting an error running this. Seems to work fine on Python 3.7, but on 3.8, I get the following.
Traceback (most recent call last):
File "/Users/user/.pyenv/versions/3.8.2/lib/python3.8/runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/user/.pyenv/versions/3.8.2/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/user/.pyenv/versions/my-venv-3.8.2/lib/python3.8/site-packages/flamegraph/__main__.py", line 4, in <module>
flamegraph.main()
File "/Users/user/.pyenv/versions/my-venv-3.8.2/lib/python3.8/site-packages/flamegraph/flamegraph.py", line 146, in main
start_time = time.clock()
AttributeError: module 'time' has no attribute 'clock'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/Users/user/.pyenv/versions/my-venv-3.8.2/lib/python3.8/site-packages/flamegraph/flamegraph.py", line 99, in stop
self.join()
File "/Users/user/.pyenv/versions/3.8.2/lib/python3.8/threading.py", line 1006, in join
raise RuntimeError("cannot join thread before it is started")
RuntimeError: cannot join thread before it is started
At least for time.clock(), it seems like there are alternatives in 3.8.
Fixed with https://github.com/evanhempel/python-flamegraph/pull/17
I am still getting this error with Python 3.9. I've tried installing from pip and from git, but still getting
Traceback (most recent call last): File "/usr/local/Cellar/[email protected]/3.9.1_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/Cellar/[email protected]/3.9.1_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.9/site-packages/flamegraph/__main__.py", line 4, in <module> flamegraph.main() File "/usr/local/lib/python3.9/site-packages/flamegraph/flamegraph.py", line 146, in main start_time = time.clock() AttributeError: module 'time' has no attribute 'clock' Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/flamegraph/flamegraph.py", line 99, in stop self.join() File "/usr/local/Cellar/[email protected]/3.9.1_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 1028, in join raise RuntimeError("cannot join thread before it is started") RuntimeError: cannot join thread before it is started
Any help?