Normalise exception before extracting text (fixes issue #32)

#30 Declined
Deleted repository
default (b2fef2e6ca75)
  1. Abhinav Tripathi
  • Make sure that ptype and pvalue are of same class before trying to extract the text. Fixes crash on python3.

Comments (4)

  1. Abhinav Tripathi author

    Apparently, to increase performance, python does not enforce that ptype and pvalue in any exception be of the same exception class. This can then be enforced using PyErr_NormalizeException which is what is required here.

  2. Mike Miller repo owner

    Thank you, this fix looks right and works for me.

    You missed a space before the argument list. I went ahead and amended this since it's such a small change, tweaked the commit message, and pushed. You can strip b2fef2e on your repository.

    1. Abhinav Tripathi author

      You missed a space before the argument list.

      Oops. Sorry.

      Well, this fixes the crash due to the exception. But are you able to run test succesfully? For me pyeval and pyexec tests are passing. But pycall test is causing segfault! I tried and even pycall ("len", [10 10]) is causing segfault if I use python3...