Skip to content

Commit

Permalink
fix: add __future__ imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-iv committed Jul 12, 2024
1 parent 95d5a22 commit b2cb90d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/flask_websockets/websockets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import contextlib
import logging
from collections.abc import Callable, Generator, Iterable
from functools import wraps
from typing import TYPE_CHECKING, Any

Expand All @@ -9,6 +10,7 @@
from .websocket import WebSocket

if TYPE_CHECKING:
from collections.abc import Callable, Generator, Iterable
from wsgiref.types import StartResponse


Expand Down Expand Up @@ -81,7 +83,7 @@ def websocket_route(*args: Any, **options: Any) -> Response:
ws.close()

class WebSocketResponse(Response):
def __call__(self, environ: dict[str, Any], start_response: "StartResponse") -> Iterable[bytes]:
def __call__(self, environ: dict[str, Any], start_response: StartResponse) -> Iterable[bytes]:
if ws.mode == "gunicorn":
raise StopIteration()

Expand Down
2 changes: 2 additions & 0 deletions tests/test_client_server_integration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import platform
import time
from queue import Queue
Expand Down
2 changes: 2 additions & 0 deletions tests/test_flask_sock.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import unittest

from flask import Blueprint, Flask
Expand Down

0 comments on commit b2cb90d

Please sign in to comment.