Avoid replacing existing fields with getter methods

from @dschiller & @jianbing
https://github.com/kivy/pyjnius/issues/405
This commit is contained in:
Gabriel Pettier 2019-12-08 00:00:50 +01:00
parent e685086aba
commit b2632cd0bc
1 changed files with 3 additions and 2 deletions

View File

@ -239,6 +239,7 @@ def autoclass(clsname):
classDict[name] = (JavaStaticMethod if static else JavaMethod)(sig, varargs=varargs)
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