Skip to content

Commit 95cc8fd

Browse files
committed
Handle some pylint and bandit warnings
1 parent ac3d449 commit 95cc8fd

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

picard/cluster.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ def add(self, word):
475475
index, count = self.words[word]
476476
if index == -1:
477477
token = self.tokenize(word)
478-
if token == '':
478+
if token == '': # nosec
479479
return -1
480480
index = self.id
481481
self.ids[index] = (word, token)

picard/coverart/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def next_in_queue(self):
158158
finally:
159159
if ret != CoverArtProvider.WAIT:
160160
self.next_in_queue()
161-
return
161+
return
162162
except StopIteration:
163163
# nothing more to do
164164
self.album._finalize_loading(None)

picard/coverart/image.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __init__(self, data, prefix='picard', suffix=''):
6464
self._filename = None
6565
_datafile_mutex.lock()
6666
try:
67-
m = md5()
67+
m = md5() # nosec
6868
m.update(data)
6969
self._hash = m.hexdigest()
7070
if self._hash not in _datafiles:
@@ -337,7 +337,8 @@ def save(self, dirname, metadata, counters):
337337
except OSError as e:
338338
raise CoverArtImageIOError(e)
339339

340-
def _next_filename(self, filename, counters):
340+
@staticmethod
341+
def _next_filename(filename, counters):
341342
if counters[filename]:
342343
new_filename = "%s (%d)" % (decode_filename(filename), counters[filename])
343344
else:

resources/makeqrc.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
# along with this program; if not, write to the Free Software
2424
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2525

26+
"""Build a Qt resources file with all png images found under images/
27+
It will update qrc file only if images newer than it are found
28+
"""
2629

2730
from distutils import log
2831
from distutils.dep_util import newer
@@ -31,20 +34,15 @@
3134
import re
3235

3336

34-
"""Build a Qt resources file with all png images found under images/
35-
It will update qrc file only if images newer than it are found
36-
"""
37-
38-
3937
def tryint(s):
4038
try:
4139
return int(s)
42-
except:
40+
except BaseException:
4341
return s
4442

4543

4644
def natsort_key(s):
47-
return [ tryint(c) for c in re.split(r'(\d+)', s) ]
45+
return [tryint(c) for c in re.split(r'(\d+)', s)]
4846

4947

5048
def find_files(topdir, directory, patterns):

0 commit comments

Comments
 (0)