From 8515ef174610c084babbc8c9918db5c8ba9db7e5 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 5 May 2021 13:58:47 +0200 Subject: [PATCH] Update handling errors example Use asyncio.sleep instead of time.sleep --- docs/source/start/errors.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/source/start/errors.rst b/docs/source/start/errors.rst index f5747d77..8e592f18 100644 --- a/docs/source/start/errors.rst +++ b/docs/source/start/errors.rst @@ -96,10 +96,12 @@ The value is stored in the ``x`` attribute of the exception object: .. code-block:: python - import time + import asyncio from pyrogram.errors import FloodWait - try: - ... # Your code - except FloodWait as e: - time.sleep(e.x) # Wait "x" seconds before continuing + ... + try: + ... # Your code + except FloodWait as e: + await asyncio.sleep(e.x) # Wait "x" seconds before continuing + ... \ No newline at end of file