Try Py2.5 compatibility as last fallback for thread identity.

This commit is contained in:
Aarni Koskela 2014-01-21 08:37:37 +02:00 committed by Jeff Forcier
parent b0c689d7c8
commit 39809dab31
1 changed files with 5 additions and 3 deletions

View File

@ -40,10 +40,12 @@ win32con_WM_COPYDATA = 74
def get_thread_ident(): def get_thread_ident():
try: # thread.get_ident() exists from Py2.5 to Py2.7. # thread.get_ident() exists from Py2.5 to Py2.7.
return thread.get_ident() # threading.current_thread().ident exists from Py2.6 up to Py3.4.
except AttributeError: # threading.current_thread().ident exists from Py2.6 up to Py3.4. try:
return threading.current_thread().ident return threading.current_thread().ident
except AttributeError:
return thread.get_ident()
def _get_pageant_window_object(): def _get_pageant_window_object():