rkern / line_profiler

(OLD REPO) Line-by-line profiling for Python - Current repo ->
https://github.com/pyutils/line_profiler
Other
3.61k stars 255 forks source link

No output when script uses os._exit(0) #55

Closed mszlazak closed 8 years ago

mszlazak commented 8 years ago

FYI, if you use os._exit(0) on at least Ubuntu 14.04 with Python 3.5.1 then there will be no profiler output on your console with kernprof -l -v my_script.py my_data.txt.

if __name__ == "__main__":
    from os import _exit
    main()
    _exit(0)
rkern commented 8 years ago

Sorry, nothing we can do about that. os._exit() avoids all of the hooks that we could use to run the output code.