Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyjnius should use "bound" methods instead of changing j_self #563

Open
obfusk opened this issue Oct 22, 2020 · 0 comments
Open

pyjnius should use "bound" methods instead of changing j_self #563

obfusk opened this issue Oct 22, 2020 · 0 comments

Comments

@obfusk
Copy link
Contributor

obfusk commented Oct 22, 2020

def __get__(self, obj, objtype):
if obj is None:
return self
# XXX FIXME we MUST not change our own j_self, but return a "bound"
# method here, as python does!
cdef JavaClass jc = obj
self.j_self = jc.j_self
return self

def __get__(self, obj, objtype):
if obj is None:
self.j_self = None
return self
# XXX FIXME we MUST not change our own j_self, but return a "bound"
# method here, as python does!
cdef JavaClass jc = obj
self.j_self = jc.j_self
return self

I suspect the current behaviour may not be thread-safe, but I haven't been able to reproduce #287.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant