From 7cd784155649bb675cebc3863d5c16569954c753 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Tue, 9 Aug 2005 06:30:22 +0000 Subject: [PATCH] [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-51] rename 3 globals so they're not exposed in docs --- paramiko/util.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/paramiko/util.py b/paramiko/util.py index 82ac91c..d0d2c0d 100644 --- a/paramiko/util.py +++ b/paramiko/util.py @@ -226,21 +226,21 @@ def mod_inverse(x, m): u2 += m return u2 -g_thread_ids = {} -g_thread_counter = 0 -g_thread_lock = threading.Lock() +_g_thread_ids = {} +_g_thread_counter = 0 +_g_thread_lock = threading.Lock() def get_thread_id(): - global g_thread_ids, g_thread_counter + global _g_thread_ids, _g_thread_counter, _g_thread_lock tid = id(threading.currentThread()) try: - return g_thread_ids[tid] + return _g_thread_ids[tid] except KeyError: - g_thread_lock.acquire() + _g_thread_lock.acquire() try: - g_thread_counter += 1 - ret = g_thread_ids[tid] = g_thread_counter + _g_thread_counter += 1 + ret = _g_thread_ids[tid] = _g_thread_counter finally: - g_thread_lock.release() + _g_thread_lock.release() return ret def log_to_file(filename, level=DEBUG):