diff --git a/cs/client.py b/cs/client.py index 6b0d0f0..9a2ced4 100644 --- a/cs/client.py +++ b/cs/client.py @@ -9,8 +9,7 @@ from datetime import datetime, timedelta from fnmatch import fnmatch from urllib.parse import quote - -import pytz +from zoneinfo import ZoneInfo import requests from requests.structures import CaseInsensitiveDict @@ -245,8 +244,9 @@ def _prepare_request( params.setdefault("pagesize", PAGE_SIZE) if "expires" not in params and self.expiration.total_seconds() >= 0: params["signatureVersion"] = "3" - tz = pytz.utc - expires = tz.localize(datetime.utcnow() + self.expiration) + tz = ZoneInfo("UTC") + expires = datetime.utcnow() + self.expiration + expires = expires.replace(tzinfo=tz) params["expires"] = expires.astimezone(tz).strftime(EXPIRES_FORMAT) kind = "params" if self.method == "get" else "data" diff --git a/setup.cfg b/setup.cfg index 6b28e79..3be065e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,6 @@ packages = find: include_package_data = true zip_safe = false install_requires = - pytz requests [options.packages.find]