Skip to content

Commit c14f0bc

Browse files
fix pylint issues (#574)
1 parent db1d298 commit c14f0bc

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

lib/inputstreamhelper/utils.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,22 @@
33
"""Implements various Helper functions"""
44

55
from __future__ import absolute_import, division, unicode_literals
6+
67
import os
78
import re
8-
from time import time
9+
import struct
10+
from functools import total_ordering
911
from socket import timeout
1012
from ssl import SSLError
11-
import struct
13+
from time import time
1214
from typing import NamedTuple
13-
from functools import total_ordering
14-
15-
try: # Python 3
16-
from urllib.error import HTTPError, URLError
17-
from urllib.request import Request, urlopen
18-
except ImportError: # Python 2
19-
from urllib2 import HTTPError, Request, URLError, urlopen
15+
from urllib.error import HTTPError, URLError
16+
from urllib.request import Request, urlopen
2017

2118
from . import config
22-
from .kodiutils import (bg_progress_dialog, copy, delete, exists, get_setting, localize, log, mkdirs,
23-
progress_dialog, set_setting, stat_file, translate_path, yesno_dialog)
19+
from .kodiutils import (bg_progress_dialog, copy, delete, exists, get_setting,
20+
localize, log, mkdirs, progress_dialog, set_setting,
21+
stat_file, translate_path, yesno_dialog)
2422
from .unicodes import compat_path, from_unicode, to_unicode
2523

2624

@@ -123,7 +121,7 @@ def http_head(url):
123121
def http_download(url, message=None, checksum=None, hash_alg='sha1', dl_size=None, background=False): # pylint: disable=too-many-statements
124122
"""Makes HTTP request and displays a progress dialog on download."""
125123
if checksum:
126-
from hashlib import sha1, md5
124+
from hashlib import md5, sha1
127125
if hash_alg == 'sha1':
128126
calc_checksum = sha1()
129127
elif hash_alg == 'md5':
@@ -324,7 +322,6 @@ def arch():
324322
sys_arch = 'x86' # else, sys_arch = AMD64
325323

326324
elif 'armv' in sys_arch:
327-
import re
328325
arm_version = re.search(r'\d+', sys_arch.split('v')[1])
329326
if arm_version:
330327
sys_arch = 'armv' + arm_version.group()

0 commit comments

Comments
 (0)