From f228b7e5c257b0f3f4fa6d489910634234b376a6 Mon Sep 17 00:00:00 2001 From: Fabien Coelho Date: Sun, 15 Sep 2024 08:51:11 +0200 Subject: [PATCH] Self is not available in types in 3.10 --- FlaskTester.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/FlaskTester.py b/FlaskTester.py index 8a0c011..d618274 100755 --- a/FlaskTester.py +++ b/FlaskTester.py @@ -6,7 +6,8 @@ import os import io import re -from typing import Any, Callable, Self +# Python >= 3.11: Self +from typing import Any, Callable import importlib import logging import pytest # for explicit fail calls, see _pytestFail @@ -309,7 +310,8 @@ class Client: """ # client login/pass hook (with mypy workaround) - AuthHook = Callable[[Self, str, str|None], None] # type: ignore + # Python >= 3.11: Self + AuthHook = Callable[[Any, str, str|None], None] # type: ignore def __init__(self, auth: Authenticator, default_login: str|None = None): self._auth = auth