From 0258a540165a7eb005e55c084c19f76bfff0190b Mon Sep 17 00:00:00 2001 From: eyMarv Date: Wed, 28 Aug 2024 18:49:38 +0200 Subject: [PATCH] black code format Signed-off-by: eyMarv --- pyrogram/client.py | 5 ++++- pyrogram/dispatcher.py | 9 +++++++-- pyrogram/session/session.py | 6 +++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pyrogram/client.py b/pyrogram/client.py index 1085558df..8752397f6 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -702,7 +702,10 @@ async def handle_updates(self, updates): except ChannelPrivate: pass except PersistentTimestampInvalid: - log.warning("[pyroblack] Client [%s] got PERSISTENT_TIMESTAMP_INVALID.", self.name) + log.warning( + "[pyroblack] Client [%s] got PERSISTENT_TIMESTAMP_INVALID.", + self.name, + ) else: if not isinstance( diff, raw.types.updates.ChannelDifferenceEmpty diff --git a/pyrogram/dispatcher.py b/pyrogram/dispatcher.py index 21ad4362d..e855ee530 100644 --- a/pyrogram/dispatcher.py +++ b/pyrogram/dispatcher.py @@ -318,8 +318,13 @@ async def start(self): ) except (errors.ChannelPrivate, errors.ChannelInvalid): break - except errors.exceptions.bad_request_400.PersistentTimestampInvalid: - log.warning("[pyroblack]-recover-updates- Client [%s] got PERSISTENT_TIMESTAMP_INVALID.", self.client.name) + except ( + errors.exceptions.bad_request_400.PersistentTimestampInvalid + ): + log.warning( + "[pyroblack]-recover-updates- Client [%s] got PERSISTENT_TIMESTAMP_INVALID.", + self.client.name, + ) break if isinstance(diff, raw.types.updates.DifferenceEmpty): break diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 2401b4469..880ff4019 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -575,7 +575,11 @@ async def invoke( return # stop instantly if not self.is_started.is_set(): - if self.currently_restarting or self.currently_stopping or self.currently_starting: + if ( + self.currently_restarting + or self.currently_stopping + or self.currently_starting + ): await self.is_started.wait() else: # need to start await self.start()