From bc33edb9e6bb7152caa126dc1d0016c96e8d637f Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Tue, 12 Dec 2023 13:53:26 +0100 Subject: [PATCH] Ahh, it does exist on 3.10, let's see of mypy on 3.10 likes it, too --- src/fontra/core/server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fontra/core/server.py b/src/fontra/core/server.py index 7a287c7a8..ca040443d 100644 --- a/src/fontra/core/server.py +++ b/src/fontra/core/server.py @@ -12,6 +12,7 @@ from functools import partial from http.cookies import SimpleCookie from importlib import resources +from importlib.abc import Traversable from importlib.metadata import entry_points from typing import Any, Optional from urllib.parse import quote @@ -304,7 +305,7 @@ def addVersionTokenToReferences(data: bytes, versionToken, extensions) -> bytes: return re.sub(pattern, repl, data) -def getResourcePath(modulePath: str, resourceName: str) -> Any: +def getResourcePath(modulePath: str, resourceName: str) -> Traversable: moduleParts = modulePath.split(".") moduleRoot = resources.files(moduleParts[0]) return moduleRoot.joinpath(*moduleParts[1:], resourceName)