/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/http_server.py

  • Committer: Andrew Bennetts
  • Date: 2008-10-01 06:10:17 UTC
  • mfrom: (3753 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3755.
  • Revision ID: andrew.bennetts@canonical.com-20081001061017-z97p3m0n9qqjzklf
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import posixpath
21
21
import random
22
22
import re
 
23
import select
23
24
import SimpleHTTPServer
24
25
import socket
25
26
import SocketServer
418
419
        # Allows tests to verify number of GET requests issued
419
420
        self.GET_request_nb = 0
420
421
 
 
422
    def __repr__(self):
 
423
        return "%s(%s:%s)" % \
 
424
            (self.__class__.__name__, self.host, self.port)
 
425
 
421
426
    def _get_httpd(self):
422
427
        if self._httpd is None:
423
428
            rhandler = self.request_handler
467
472
                httpd.handle_request()
468
473
            except socket.timeout:
469
474
                pass
 
475
            except (socket.error, select.error), e:
 
476
               if e[0] == errno.EBADF:
 
477
                   # Starting with python-2.6, handle_request may raise socket
 
478
                   # or select exceptions when the server is shut down (as we
 
479
                   # do).
 
480
                   pass
 
481
               else:
 
482
                   raise
470
483
 
471
484
    def _get_remote_url(self, path):
472
485
        path_parts = path.split(os.path.sep)