Permalink
Browse files

Merge branch 'dev_3.6'

  • Loading branch information...
2 parents 6cad5fe + 9eeb14c commit 44bb03c56ca2724f40ee7bccdeee37124b189c2e @ndjensen ndjensen committed Jan 13, 2017
Showing with 19 additions and 9 deletions.
  1. +1 −1 jep/version.py
  2. +15 −0 src/jep/jep_util.c
  3. +3 −8 src/jep/pyembed.c
View
@@ -1,2 +1,2 @@
-__VERSION__ = '3.6.2'
+__VERSION__ = '3.6.3'
VERSION = __VERSION__
View
@@ -673,6 +673,21 @@ int pyarg_matches_jtype(JNIEnv *env,
return 1;
}
}
+ } else if(PyUnicode_Check(param)) {
+ switch (paramTypeId) {
+ case JSTRING_ID:
+ return 3;
+ break;
+ case JCHAR_ID:
+ if (PyUnicode_GET_SIZE(param) == 1) {
+ return 2;
+ }
+ break;
+ case JOBJECT_ID:
+ if ((*env)->IsAssignableFrom(env, JSTRING_TYPE, paramType)) {
+ return 1;
+ }
+ }
} else if (PyFloat_Check(param)) {
switch (paramTypeId) {
case JFLOAT_ID:
View
@@ -1048,9 +1048,7 @@ intptr_t pyembed_create_module_on(JNIEnv *env,
EXIT:
Py_XDECREF(globals);
-
PyEval_ReleaseThread(jepThread->tstate);
-
return ret;
}
@@ -1134,9 +1132,8 @@ jobject pyembed_getvalue_on(JNIEnv *env,
}
EXIT:
- PyEval_ReleaseThread(jepThread->tstate);
-
Py_XDECREF(result);
+ PyEval_ReleaseThread(jepThread->tstate);
return ret;
}
@@ -1183,9 +1180,8 @@ jobject pyembed_getvalue(JNIEnv *env, intptr_t _jepThread, char *str)
}
EXIT:
- PyEval_ReleaseThread(jepThread->tstate);
-
Py_XDECREF(result);
+ PyEval_ReleaseThread(jepThread->tstate);
return ret;
}
@@ -1250,9 +1246,8 @@ jobject pyembed_getvalue_array(JNIEnv *env, intptr_t _jepThread, char *str)
EXIT:
- PyEval_ReleaseThread(jepThread->tstate);
-
Py_XDECREF(result);
+ PyEval_ReleaseThread(jepThread->tstate);
return ret;
}

0 comments on commit 44bb03c

Please sign in to comment.