From 39809dab310b50d781f247ebbc89cf863fb545d3 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Tue, 21 Jan 2014 08:37:37 +0200 Subject: [PATCH] Try Py2.5 compatibility as last fallback for thread identity. --- paramiko/win_pageant.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/paramiko/win_pageant.py b/paramiko/win_pageant.py index 1c0bc98..2f6db4f 100644 --- a/paramiko/win_pageant.py +++ b/paramiko/win_pageant.py @@ -40,10 +40,12 @@ win32con_WM_COPYDATA = 74 def get_thread_ident(): - try: # thread.get_ident() exists from Py2.5 to Py2.7. - return thread.get_ident() - except AttributeError: # threading.current_thread().ident exists from Py2.6 up to Py3.4. + # thread.get_ident() exists from Py2.5 to Py2.7. + # threading.current_thread().ident exists from Py2.6 up to Py3.4. + try: return threading.current_thread().ident + except AttributeError: + return thread.get_ident() def _get_pageant_window_object():