~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/stub_sftp.py

  • Committer: John Arbash Meinel
  • Date: 2010-05-11 14:13:31 UTC
  • mto: (5218.2.2 bytes_to_entry_c)
  • mto: This revision was merged to the branch mainline in revision 5225.
  • Revision ID: john@arbash-meinel.com-20100511141331-rizo2ez6bze3ao66
Some small tweaks to the chk_map code.

Find out that we actually weren't using the global definition because we
were assigning inside the if block. So factor that out into a helper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
283
283
        self._socket.close()
284
284
 
285
285
    def run(self):
 
286
        trace.mutter('SocketListener %r has started', self)
286
287
        while True:
287
288
            readable, writable_unused, exception_unused = \
288
289
                select.select([self._socket], [], [], 0.1)
289
290
            if self._stop_event.isSet():
 
291
                trace.mutter('SocketListener %r has stopped', self)
290
292
                return
291
293
            if len(readable) == 0:
292
294
                continue
293
295
            try:
294
296
                s, addr_unused = self._socket.accept()
 
297
                trace.mutter('SocketListener %r has accepted connection %r',
 
298
                    self, s)
295
299
                # because the loopback socket is inline, and transports are
296
300
                # never explicitly closed, best to launch a new thread.
297
301
                threading.Thread(target=self._callback, args=(s,)).start()