Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ keywords = [
"scraping",
]
dependencies = [
"async-timeout>=5.0.1",
# Only needed for Python 3.10; 3.11+ uses stdlib `asyncio.timeout` (#2052).
"async-timeout>=5.0.1; python_version < '3.11'",
"cachetools>=5.5.0",
"colorama>=0.4.0",
"impit>=0.8.0",
Expand Down
9 changes: 8 additions & 1 deletion src/crawlee/_utils/time.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
from __future__ import annotations

import sys
import time
from contextlib import contextmanager
from dataclasses import dataclass
from datetime import timedelta
from typing import TYPE_CHECKING

from async_timeout import Timeout, timeout
if sys.version_info >= (3, 11):
# `asyncio.timeout` was added in Python 3.11 and is the recommended replacement
# for the deprecated `async-timeout` package (#2052).
from asyncio import Timeout, timeout
else:
# Python 3.10: `async-timeout` is the official backport of the same API.
from async_timeout import Timeout, timeout

if TYPE_CHECKING:
from collections.abc import Iterator
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.