mirror of https://github.com/kivy/pyjnius.git
when calculating the score, check the assignable from too, and return -1 if the check doesn't work.
This commit is contained in:
parent
79b564a338
commit
35ef6575d8
|
@ -169,8 +169,11 @@ cdef int calculate_score(sign_args, args) except *:
|
|||
if jc.__javaclass__ == r:
|
||||
score += 10
|
||||
else:
|
||||
# can be dangerous
|
||||
score += 1
|
||||
try:
|
||||
check_assignable_from(jc, r)
|
||||
except:
|
||||
return -1
|
||||
score += 5
|
||||
continue
|
||||
|
||||
# always accept unknow object, but can be dangerous too.
|
||||
|
|
Loading…
Reference in New Issue