Skip to content

Commit 6eaa61d

Browse files
committed
fix: TypeError over Session Datetime when Refreshing Tokens
1 parent 69a790a commit 6eaa61d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

etsy_python/v3/resources/Session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from datetime import datetime, timedelta
1+
from datetime import datetime, timedelta, timezone
22
from typing import Any, Callable, Dict, Optional
33

44
from requests import Session
@@ -99,7 +99,7 @@ def make_request(
9999
if method not in {Method.GET, Method.DELETE} and payload is None:
100100
raise ValueError(f"Improper payload for {method}")
101101

102-
if datetime.utcnow() >= self.expiry:
102+
if datetime.now(tz=timezone.utc) >= self.expiry.replace(tzinfo=timezone.utc):
103103
self.update_token()
104104

105105
uri_path = f"{environment.request_url}{uri_path}"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
88
long_description = "\n" + fh.read()
99

10-
VERSION = "1.0.14"
10+
VERSION = "1.0.15"
1111
DESCRIPTION = "Etsy API Client Library for Python"
1212

1313
# Setting up

0 commit comments

Comments
 (0)