Advertisement
Guest User

azd

a guest
Oct 26th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # Android only
  2. if "ANDROID_ARGUMENT" in os.environ:
  3. # on android, catch all exception to ensure about a jnius.detach
  4. import threading
  5. import jnius
  6. orig_thread_run = threading.Thread.run
  7.  
  8. def jnius_thread_hook(*args, **kwargs):
  9. try:
  10. return orig_thread_run(*args, **kwargs)
  11. finally:
  12. jnius.detach()
  13.  
  14. threading.Thread.run = jnius_thread_hook
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement