Permalink
Browse files

better method picking with unicode objects

  • Loading branch information...
1 parent 7de8747 commit 95f8f88d948c27f806d1dab6bf75d5319e74635a @ndjensen ndjensen committed Jan 11, 2017
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/jep/jep_util.c
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:

0 comments on commit 95f8f88

Please sign in to comment.