~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/protocol.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:
22
22
from cStringIO import StringIO
23
23
import struct
24
24
import sys
 
25
import thread
25
26
import threading
26
27
import time
27
28
 
1147
1148
        self.response_sent = False
1148
1149
        self._headers = {'Software version': bzrlib.__version__}
1149
1150
        if 'hpss' in debug.debug_flags:
1150
 
            # python 2.6 introduced 'ident' as a nice small integer to
1151
 
            # represent a thread. But it doesn't exist in 2.4/2.5
1152
 
            cur_thread = threading.currentThread()
1153
 
            self._thread_id = getattr(cur_thread, 'ident', None)
1154
 
            if self._thread_id is None:
1155
 
                self._thread_id = cur_thread.getName()
 
1151
            self._thread_id = thread.get_ident()
1156
1152
            self._response_start_time = None
1157
1153
 
1158
1154
    def _trace(self, action, message, extra_bytes=None, include_time=False):