소스 검색

app_python3s: fix exception handling

Python's C interface contract states that C code must *either*
raise an exception and return NULL, *or* return a Python object.
Matthias Urlichs 9 달 전
부모
커밋
ef73fb876f
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/modules/app_python3s/apy3s_kemi.c

+ 2 - 2
src/modules/app_python3s/apy3s_kemi.c

@@ -409,7 +409,7 @@ PyObject *sr_apy_kemi_exec_func_ex(
 		if(pobj == NULL) {
 			LM_ERR("null parameter - func: %.*s idx: %d argc: %d\n", fname.len,
 					fname.s, i, (int)alen);
-			return sr_kemi_apy_return_false();
+			return NULL;
 		}
 		if(ket->ptypes[i] == SR_KEMIP_STR) {
 			if(!PyUnicode_Check(pobj)) {
@@ -421,7 +421,7 @@ PyObject *sr_apy_kemi_exec_func_ex(
 			if(vps[i].v.s.s == NULL) {
 				LM_ERR("null-string parameter - func: %.*s idx: %d argc: %d\n",
 						fname.len, fname.s, i, (int)alen);
-				return sr_kemi_apy_return_false();
+				return NULL;
 			}
 			vps[i].v.s.len = (int)slen;
 			vps[i].vtype = SR_KEMIP_STR;