Fix traceback.print_exc call

`traceback.print_exc` expects `limit` as a first argument. Passing
excepiton instance (AssertionError in example below) raises TypeError
inside of traceback module:
```
TypeError: unorderable types: AssertionError() >= int()
```
This commit is contained in:
Georgy Dyuldin 2017-11-20 18:21:27 +03:00
parent 52ec55563e
commit c9b6348a2b
1 changed files with 6 additions and 6 deletions

View File

@ -46,8 +46,8 @@ cdef class PythonJavaClass(object):
try: try:
ret = self._invoke(method, *args) ret = self._invoke(method, *args)
return ret return ret
except Exception as e: except Exception:
traceback.print_exc(e) traceback.print_exc()
return None return None
def _invoke(self, method, *args): def _invoke(self, method, *args):
@ -141,16 +141,16 @@ cdef jobject py_invoke0(JNIEnv *j_env, jobject j_this, jobject j_proxy, jobject
try: try:
return convert_python_to_jobject(j_env, jtype or ret_signature, ret) return convert_python_to_jobject(j_env, jtype or ret_signature, ret)
except Exception as e: except Exception:
traceback.print_exc(e) traceback.print_exc()
cdef jobject invoke0(JNIEnv *j_env, jobject j_this, jobject j_proxy, jobject cdef jobject invoke0(JNIEnv *j_env, jobject j_this, jobject j_proxy, jobject
j_method, jobjectArray args) with gil: j_method, jobjectArray args) with gil:
try: try:
return py_invoke0(j_env, j_this, j_proxy, j_method, args) return py_invoke0(j_env, j_this, j_proxy, j_method, args)
except Exception as e: except Exception:
traceback.print_exc(e) traceback.print_exc()
return NULL return NULL
# now we need to create a proxy and pass it an invocation handler # now we need to create a proxy and pass it an invocation handler