Skip to content

Commit

Permalink
style: Fix f-string-number-format (FURB116) (#4030)
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix committed Jul 11, 2024
1 parent ff2da11 commit 52a7fd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ ignore = [
"FURB101", # read-whole-file
"FURB103", # write-whole-file.
"FURB105", # print-empty-string
"FURB116", # f-string-number-format
"FURB116", # f-string-number-format
"FURB118", # reimplemented-operator
"FURB129", # readlines-in-for
"FURB131", # delete-full-slice
Expand Down
6 changes: 3 additions & 3 deletions python/grass/imaging/images2swf.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def bitsToInt(bb, n=8):
# Get value in bits
for i in range(len(bb)):
b = bb[i : i + 1]
tmp = bin(ord(b))[2:]
tmp = f"{ord(b):b}"
# value += tmp.rjust(8,'0')
value = tmp.rjust(8, "0") + value

Expand All @@ -271,7 +271,7 @@ def getTypeAndLen(bb):
# Get first 16 bits
for i in range(2):
b = bb[i : i + 1]
tmp = bin(ord(b))[2:]
tmp = f"{ord(b):b}"
# value += tmp.rjust(8,'0')
value = tmp.rjust(8, "0") + value

Expand All @@ -285,7 +285,7 @@ def getTypeAndLen(bb):
value = ""
for i in range(2, 6):
b = bb[i : i + 1] # becomes a single-byte bytes() on both PY3 and PY2
tmp = bin(ord(b))[2:]
tmp = f"{ord(b):b}"
# value += tmp.rjust(8,'0')
value = tmp.rjust(8, "0") + value
L = int(value, 2)
Expand Down

0 comments on commit 52a7fd7

Please sign in to comment.