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

« back to all changes in this revision

Viewing changes to UpdateManager/Core/MyCache.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:
20
20
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21
21
#  USA
22
22
 
23
 
from __future__ import absolute_import, print_function
24
 
 
25
23
import warnings
26
24
 
27
25
warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning)
30
28
import logging
31
29
import os
32
30
 
33
 
try:
34
 
    from urllib.error import HTTPError
35
 
    from urllib.request import urlopen
36
 
    from urllib.parse import urlsplit
37
 
except ImportError:
38
 
    from urllib2 import HTTPError, urlopen
39
 
    from urlparse import urlsplit
40
 
try:
41
 
    from http.client import BadStatusLine
42
 
except ImportError:
43
 
    from httplib import BadStatusLine
 
31
from urllib.error import HTTPError
 
32
from urllib.request import urlopen
 
33
from urllib.parse import urlsplit
 
34
from http.client import BadStatusLine
44
35
import socket
45
36
import subprocess
46
37
import re