/breezy/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/trunk

« back to all changes in this revision

Viewing changes to breezy/tests/http_server.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

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):