Skip to content

Commit

Permalink
remove overload
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Sep 9, 2024
1 parent 19c6da9 commit 68f944b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/servestatic/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import re
import warnings
from posixpath import normpath
from typing import Callable, overload
from typing import Callable
from wsgiref.headers import Headers

from .media_types import MediaTypes
Expand All @@ -18,6 +18,9 @@ class BaseServeStatic:
# so we'll follow its lead
FOREVER = 10 * 365 * 24 * 60 * 60

__call__: Callable
""""Subclasses must implement `__call__`"""

def __init__(
self,
application,
Expand Down Expand Up @@ -68,12 +71,6 @@ def __init__(
if root is not None:
self.add_files(root, prefix)

@overload
async def __call__(self, *args, **kwargs): ...

def __call__(self, *args, **kwargs):
raise NotImplementedError("Subclasses must implement `__call__`")

def add_files(self, root, prefix=None):
root = os.path.abspath(root)
root = root.rstrip(os.path.sep) + os.path.sep
Expand Down

0 comments on commit 68f944b

Please sign in to comment.