[1.1.4 PyJnius] Fix ' TypeError: 'float' object is not callable '

Asked by Dirk Schiller on 2019-02-10

Found a Solution for the '# pat.similar(1.0) # Throw an Error: TypeError: 'float' object is not callable':

In 'C:\Users\DOP\AppData\Local\Programs\Python\Python37\Lib\site-packages\jnius\reflect.py' change ( Line 188 with pyjnius Version 1.2.0 ):

        if name != 'getClass' and bean_getter(name) and len(method.getParameterTypes()) == 0:
            lowername = lower_name(name[2 if name.startswith('is') else 3:])
            classDict[lowername] = (lambda n: property(lambda self: getattr(self, n)()))(name)
        continue

to:

        if name != 'getClass' and bean_getter(name) and len(method.getParameterTypes()) == 0:
            lowername = lower_name(name[2 if name.startswith('is') else 3:])
            if lowername not in methods_name:
             classDict[lowername] = (lambda n: property(lambda self: getattr(self, n)()))(name)
        continue

Also gave this to the Issue Tracker at PyJnius on GitHub.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-02-10
Last reply:
2019-02-10
RaiMan (raimund-hocke) said : #1

Thanks.
Interesting ;-)