Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mg98 committed Oct 15, 2024
1 parent b782cbe commit 67b33cc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/tribler/core/database/orm_bindings/torrent_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def tdef_to_metadata_dict(tdef: TorrentDef) -> dict:
"title": tdef.get_name_as_unicode()[:300],
"tags": tags[:200],
"size": tdef.get_length(),
"torrent_date": torrent_date if torrent_date >= EPOCH else EPOCH,
"torrent_date": max(torrent_date, EPOCH),
"tracker_info": tracker_info,
}

Expand Down
2 changes: 1 addition & 1 deletion src/tribler/core/libtorrent/download_manager/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ async def open(self) -> None:

while not filename.exists():
await sleep(1)
self.file = open(filename, "rb") # noqa: ASYNC101, SIM115
self.file = open(filename, "rb") # noqa: SIM115
self.file.seek(self.seekpos)

@property
Expand Down
2 changes: 1 addition & 1 deletion src/tribler/core/rendezvous/orm_bindings/certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RendezvousCertificate(metaclass=IterRendezvousCertificate):
start: float
stop: float

def __init__(self, public_key: bytes, ip: bytes, port: int, ping: float, # noqa: D107, PLR0913
def __init__(self, public_key: bytes, ip: bytes, port: int, ping: float, # noqa: D107
start: float, stop: float) -> None: ...

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion src/tribler/core/torrent_checker/torrentchecker_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class UdpTrackerSession(TrackerSession):
# A list of transaction IDs that have been used in order to avoid conflict.
_active_session_dict: dict[UdpTrackerSession, int] = {}

def __init__(self, tracker_url: str, tracker_address: tuple[str, int], announce_page: str, # noqa: PLR0913
def __init__(self, tracker_url: str, tracker_address: tuple[str, int], announce_page: str,
timeout: float, proxy: tuple, socket_mgr: UdpSocketManager) -> None:
"""
Create a session for UDP trackers.
Expand Down
4 changes: 2 additions & 2 deletions src/tribler/test_unit/core/recommender/test_community.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def test_crawl_query_v0(self) -> None:
with self.assertReceivedBy(1, [CrawlResponse, CrawlResponse, CrawlResponse]) as messages:
self.crawler_overlay().crawl_next(self.peer(0))
await self.deliver_messages()

response1 = json.loads(messages[0].data)
response2 = json.loads(messages[1].data)
response3 = json.loads(messages[2].data)
Expand Down Expand Up @@ -164,7 +164,7 @@ async def test_crawl_query_v1(self) -> None:
with self.assertReceivedBy(1, [CrawlResponse, CrawlResponse, CrawlResponse]) as messages:
self.crawler_overlay().crawl_next(self.peer(0))
await self.deliver_messages()

response1 = json.loads(messages[0].data)
response2 = json.loads(messages[1].data)
response3 = json.loads(messages[2].data)
Expand Down

0 comments on commit 67b33cc

Please sign in to comment.