Skip to content
This repository was archived by the owner on Apr 26, 2025. It is now read-only.

Commit ca4ef35

Browse files
Update middlewares.py
1 parent 5adc95b commit ca4ef35

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ninja_put_patch_file_upload_middleware/middlewares.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
from collections.abc import Callable
2-
from typing import Any, Union
3-
1+
import sys
42
from asgiref.sync import iscoroutinefunction, sync_to_async
53
from django.http import HttpRequest, HttpResponse
64
from django.utils.decorators import sync_and_async_middleware
5+
from typing import Any
6+
7+
if sys.version_info >= (3, 9):
8+
from collections.abc import Callable
9+
else:
10+
from typing import Callable
11+
12+
if sys.version_info >= (3, 10):
13+
from typing import Union
14+
else:
15+
from typing_extensions import Union
716

817

918
@sync_and_async_middleware

0 commit comments

Comments
 (0)