/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 breezy/tests/http_server.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-07 02:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200207021430-m49iq3x4x8xlib6x
Drop python2 support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
import errno
18
 
try:
19
 
    import http.client as http_client
20
 
    import http.server as http_server
21
 
except ImportError:
22
 
    import httplib as http_client
23
 
    import SimpleHTTPServer as http_server
 
18
import http.client as http_client
 
19
import http.server as http_server
24
20
import os
25
21
import posixpath
26
22
import random
27
23
import re
28
24
import socket
29
25
import sys
30
 
try:
31
 
    from urlparse import urlparse
32
 
except ImportError:
33
 
    from urllib.parse import urlparse
 
26
from urllib.parse import urlparse
34
27
 
35
28
from .. import (
36
29
    osutils,
340
333
        # abandon query parameters
341
334
        path = urlparse(path)[2]
342
335
        path = posixpath.normpath(urlutils.unquote(path))
343
 
        if sys.version_info[0] == 2:
344
 
            path = path.decode('utf-8')
345
336
        words = path.split('/')
346
337
        path = self._cwd
347
338
        for num, word in enumerate(w for w in words if w):