~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/medium.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-21 17:00:29 UTC
  • mto: This revision was merged to the branch mainline in revision 4914.
  • Revision ID: john@arbash-meinel.com-20091221170029-ef1zyr07p38p2qz6
Switch to using thread.get_ident() which is available on all python versions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from bzrlib.lazy_import import lazy_import
34
34
lazy_import(globals(), """
35
35
import atexit
36
 
import threading
 
36
import thread
37
37
import weakref
38
38
 
39
39
from bzrlib import (
300
300
        tstart = osutils.timer_func()
301
301
        osutils.send_all(self.socket, bytes, self._report_activity)
302
302
        if 'hpss' in debug.debug_flags:
303
 
            cur_thread = threading.currentThread()
304
 
            thread_id = getattr(cur_thread, 'ident', None)
305
 
            if thread_id is None:
306
 
                thread_id = cur_thread.getName()
 
303
            thread_id = thread.get_ident()
307
304
            trace.mutter('%12s: [%s] %d bytes to the socket in %.3fs'
308
305
                         % ('wrote', thread_id, len(bytes),
309
306
                            osutils.timer_func() - tstart))