Skip to content

Commit

Permalink
Make Flake8 happy, address deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoPrevato committed Nov 2, 2023
1 parent 428548c commit 57675b0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion blacksheep/client/cookies.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from datetime import datetime, timedelta
from datetime import timedelta
from ipaddress import ip_address
from typing import Dict, Iterable, Optional, TypeVar

Expand Down
6 changes: 4 additions & 2 deletions blacksheep/server/authentication/cookie.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, UTC
from typing import Any, Optional, Sequence

from guardpost import AuthenticationHandler, Identity
Expand Down Expand Up @@ -80,7 +80,9 @@ def set_cookie(self, data: Any, response: Response, secure: bool = False) -> Non
path="/",
http_only=True,
secure=secure,
expires=datetime.fromtimestamp(data["exp"]) if "exp" in data else None,
expires=(
datetime.fromtimestamp(data["exp"], UTC) if "exp" in data else None
),
)
)

Expand Down
1 change: 0 additions & 1 deletion blacksheep/server/openapi/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import json
from abc import ABC, abstractmethod
from dataclasses import dataclass
from datetime import datetime
from enum import Enum
from http import HTTPStatus
from typing import (
Expand Down
1 change: 0 additions & 1 deletion blacksheep/server/openapi/ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
from datetime import datetime
from typing import Callable

from blacksheep.messages import Request, Response
Expand Down
2 changes: 1 addition & 1 deletion tests/client/test_cookiejar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime, timedelta
from datetime import timedelta

from blacksheep.utils.time import utcnow

Expand Down

0 comments on commit 57675b0

Please sign in to comment.