Skip to content

Instantly share code, notes, and snippets.

@sonots
Created June 28, 2017 10:11
Show Gist options
  • Save sonots/5aa82da02e5489600fe1094dc53c4ce6 to your computer and use it in GitHub Desktop.
Save sonots/5aa82da02e5489600fe1094dc53c4ce6 to your computer and use it in GitHub Desktop.
cython で .pyx も含めて stacktrace を出したい
import traceback
traceback.print_stack() #<= python レイヤーまでしかでない
@sonots
Copy link
Author

sonots commented Jun 28, 2017

https://github.com/cython/cython/blob/master/CHANGES.rst

まだリリースされていないが、これで出るようになるのか?

import traceback
import cython_runtime

cython_runtime.cline_in_traceback=True
traceback.print_stack()

@sonots
Copy link
Author

sonots commented Jun 28, 2017

違うな。traceback.print_exception() だと出るけど、print_stack() だと出ないんだ。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment