~ubuntu-core-dev/update-manager/main

« back to all changes in this revision

Viewing changes to UpdateManager/Core/utils.py

  • Committer: Benjamin Drung
  • Date: 2023-02-13 13:03:40 UTC
  • Revision ID: benjamin.drung@canonical.com-20230213130340-i79sfmerzdctcpw3
Drop imports only needed for Python 2

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22
22
#  USA
23
23
 
24
 
from __future__ import print_function
25
 
 
26
24
from gettext import gettext as _
27
25
from gettext import ngettext
28
26
from stat import S_IMODE, ST_MODE, S_IXUSR
41
39
import sys
42
40
import time
43
41
 
44
 
try:
45
 
    from urllib.request import (
46
 
        ProxyHandler,
47
 
        Request,
48
 
        build_opener,
49
 
        install_opener,
50
 
        urlopen,
51
 
    )
52
 
    from urllib.parse import urlsplit
53
 
except ImportError:
54
 
    from urllib2 import (
55
 
        ProxyHandler,
56
 
        Request,
57
 
        build_opener,
58
 
        install_opener,
59
 
        urlopen,
60
 
    )
61
 
    from urlparse import urlsplit
 
42
from urllib.request import (
 
43
    ProxyHandler,
 
44
    Request,
 
45
    build_opener,
 
46
    install_opener,
 
47
    urlopen,
 
48
)
 
49
from urllib.parse import urlsplit
62
50
 
63
51
from copy import copy
64
52