Skip to content

Commit 6c59818

Browse files
authored
Merge pull request #16 from adafruit/patch-fix
Linted
2 parents c3e25c3 + 2b2ff73 commit 6c59818

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
name: pylint (library code)
2525
types: [python]
2626
args:
27-
- --disable=consider-using-f-string
27+
- --disable=consider-using-f-string,duplicate-code
2828
exclude: "^(docs/|examples/|tests/|setup.py$)"
2929
- id: pylint
3030
name: pylint (example code)

adafruit_hashlib/_sha256.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ def sha_update(sha_info, buffer):
331331

332332
if sha_info["local"]:
333333
i = SHA_BLOCKSIZE - sha_info["local"]
334-
if i > size:
335-
i = size
334+
i = min(i, size)
336335

337336
# copy sha buffer
338337
for x in enumerate(buffer[buffer_idx : buffer_idx + i]):

adafruit_hashlib/_sha512.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,7 @@ def sha_update(sha_info, buffer):
388388

389389
if sha_info["local"]:
390390
i = SHA_BLOCKSIZE - sha_info["local"]
391-
if i > count:
392-
i = count
391+
i = min(i, count)
393392

394393
# copy buffer
395394
for x in enumerate(buffer[buffer_idx : buffer_idx + i]):

0 commit comments

Comments
 (0)