diff options
author | Robey Pointer <robey@lag.net> | 2005-08-09 06:30:22 +0000 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2005-08-09 06:30:22 +0000 |
commit | 7cd784155649bb675cebc3863d5c16569954c753 (patch) | |
tree | 4ea6add76bd1a877d84b341a054d36bfd9af2f2f | |
parent | a4fc5bb8a753ff192d3b2450a6e879a0a49a6fa9 (diff) |
[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-51]
rename 3 globals so they're not exposed in docs
-rw-r--r-- | paramiko/util.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/paramiko/util.py b/paramiko/util.py index 82ac91c8..d0d2c0de 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): |