~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/ftp_server/pyftpdlib_based.py

  • Committer: Vincent Ladeuil
  • Date: 2010-06-30 15:19:36 UTC
  • mto: (5247.6.7 http-leaks)
  • mto: This revision was merged to the branch mainline in revision 5396.
  • Revision ID: v.ladeuil+lp@free.fr-20100630151936-bwh082le0i52p8ez
Fixed as per jam's review.

* bzrlib/tests/test_server.py:
* bzrlib/tests/test_http.py:
* bzrlib/tests/http_server.py:
* bzrlib/tests/ftp_server/pyftpdlib_based.py:
* bzrlib/tests/ftp_server/medusa_based.py:
Use sys.stderr.write() rather than print for thread dbugging trace.

* bzrlib/osutils.py:
(connect_socket): Remove the timeout parameter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
        self._ftpd_thread = threading.Thread(target=self._run_server,)
186
186
        self._ftpd_thread.start()
187
187
        if 'threads' in tests.selftest_debug_flags:
188
 
            print 'Thread started: %s' % (self._ftpd_thread.ident,)
 
188
            sys.stderr.write('Thread started: %s\n'
 
189
                             % (self._ftpd_thread.ident,))
189
190
        # Wait for the server thread to start (i.e release the lock)
190
191
        self._ftpd_starting.acquire()
191
192
        self._ftpd_starting.release()
199
200
        self._ftpd_running = False
200
201
        self._ftpd_thread.join()
201
202
        if 'threads' in tests.selftest_debug_flags:
202
 
            print 'Thread  joined: %s' % (self._ftpd_thread.ident,)
 
203
            sys.stderr.write('Thread  joined: %s\n'
 
204
                             % (self._ftpd_thread.ident,))
203
205
 
204
206
    def _run_server(self):
205
207
        """Run the server until stop_server is called, shut it down properly then.