Skip to content

Commit 4890417

Browse files
committed
Ignore some invalid errors found by pylint and bandit
1 parent 3bb5c11 commit 4890417

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

domdf_python_tools/stringlist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ def splitlines(string: str) -> List[Tuple[str, str]]:
510510
else:
511511
i += 1
512512

513-
if j == 0 and eol == str_len and type(string) is str:
513+
if j == 0 and eol == str_len and type(string) is str: # pylint: disable=unidiomatic-typecheck
514514
# No whitespace in string, so just use it as the_list[0]
515515
the_list.append((string, ''))
516516
break

tests/test_getters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,4 +372,4 @@ def test_repr(self):
372372

373373
def copy(obj, proto):
374374
pickled = pickle.dumps(obj, proto)
375-
return pickle.loads(pickled)
375+
return pickle.loads(pickled) # nosec: B301

tests/test_iterative.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def test_count():
334334

335335
assert repr(count(10.25)) == "count(10.25)"
336336
assert repr(count(10.0)) == "count(10.0)"
337-
assert type(next(count(10.0))) == float
337+
assert type(next(count(10.0))) == float # pylint: disable=unidiomatic-typecheck
338338

339339
for i in (-sys.maxsize - 5, -sys.maxsize + 5, -10, -1, 0, 10, sys.maxsize - 5, sys.maxsize + 5):
340340
# Test repr
@@ -399,8 +399,8 @@ def test_count_with_stride():
399399
assert repr(count(10, 1.00)) == "count(10, 1.0)"
400400

401401
c = count(10, 1.0)
402-
assert type(next(c)) == int
403-
assert type(next(c)) == float
402+
assert type(next(c)) == int # pylint: disable=unidiomatic-typecheck
403+
assert type(next(c)) == float # pylint: disable=unidiomatic-typecheck
404404

405405
for i in (-sys.maxsize - 5, -sys.maxsize + 5, -10, -1, 0, 10, sys.maxsize - 5, sys.maxsize + 5):
406406
for j in (-sys.maxsize - 5, -sys.maxsize + 5, -10, -1, 0, 1, 10, sys.maxsize - 5, sys.maxsize + 5):
@@ -437,7 +437,7 @@ def expand(it, i=0):
437437
# Test the initial copy against the original
438438
dump = pickle.dumps(it, protocol) # nosec: B301
439439
i2 = pickle.loads(dump) # nosec: B301
440-
assert type(it) == type(i2)
440+
assert type(it) is type(i2) # pylint: disable=unidiomatic-typecheck
441441
a, b = expand(it), expand(i2)
442442
assert a == b
443443
if compare:

0 commit comments

Comments
 (0)