Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Android only
- if "ANDROID_ARGUMENT" in os.environ:
- # on android, catch all exception to ensure about a jnius.detach
- import threading
- import jnius
- orig_thread_run = threading.Thread.run
- def jnius_thread_hook(*args, **kwargs):
- try:
- return orig_thread_run(*args, **kwargs)
- finally:
- jnius.detach()
- threading.Thread.run = jnius_thread_hook
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement