Skip to content

Commit

Permalink
Fix a bunch of trivial linty stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dargueta committed Feb 13, 2025
1 parent c09ddcc commit c541126
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 62 deletions.
4 changes: 2 additions & 2 deletions binobj/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def __str__(self) -> str:
# Having a version suffix is rare for this library, so we'll tell pycoverage to
# ignore this branch.
if self.suffix: # pragma: no cover
return "%d.%d.%d-%s" % (self.major, self.minor, self.patch, self.suffix)
return "%d.%d.%d" % (self.major, self.minor, self.patch)
return f"{self.major}.{self.minor}.{self.patch}-{self.suffix}"
return f"{self.major}.{self.minor}.{self.patch}"


__version__ = importlib.metadata.version("binobj")
Expand Down
2 changes: 1 addition & 1 deletion binobj/fields/stringlike.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from binobj.typedefs import StrDict


__all__ = ["Bytes", "String", "StringZ", "UUID4", "UUIDFormat"]
__all__ = ["UUID4", "Bytes", "String", "StringZ", "UUIDFormat"]


class Bytes(Field[bytes]):
Expand Down
2 changes: 1 addition & 1 deletion binobj/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ def peek_bytes(stream: BinaryIO, count: int, short_read_okay: bool = True) -> by

if not short_read_okay and len(data) < count:
raise EOFError(
"Short read: expected %d bytes in stream, read %d." % (count, len(data))
f"Short read: expected {count} bytes in stream, read {len(data)}."
)
return data
Loading

0 comments on commit c541126

Please sign in to comment.