~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/medium.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-18 23:21:58 UTC
  • mfrom: (4911.1.2 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091218232158-sc5b6z2upfgjf30u
(jam) Fix for -Dhpss server side. Threads don't have .get_ident(),
        and py2.4/2.5 don't have .ident, fallback to .getName()

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
            thread_id = threading.currentThread().ident
 
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()
304
307
            trace.mutter('%12s: [%s] %d bytes to the socket in %.3fs'
305
308
                         % ('wrote', thread_id, len(bytes),
306
309
                            osutils.timer_func() - tstart))