diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 68a1dce..1a8569d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -4,3 +4,6 @@ sphinx: configuration: docs/conf.py fail_on_warning: false builder: html + +python: + version: 3.8 \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 876d1a5..c74d5dc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,4 +59,6 @@ html_favicon = './assets/Github-Python.png' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] \ No newline at end of file +html_static_path = ['_static'] + +autodoc_mock_imports = ["typing_extensions"] \ No newline at end of file diff --git a/github/client.py b/github/client.py index d5ca29d..8fb6c80 100644 --- a/github/client.py +++ b/github/client.py @@ -190,14 +190,16 @@ class GHClient: @functools.wraps(func) async def wrapped(self: Self, *args: P.args, **kwargs: P.kwargs) -> Optional[Union[T, User, Repository]]: if type == 'user': - if obj := self._user_cache.get(kwargs.get('user')): + obj = self._user_cache.get(kwargs.get('user')) + if obj: return obj user: User = await func(self, *args, **kwargs) # type: ignore self._user_cache[kwargs.get("user")] = user return user if type == 'repo': - if obj := self._repo_cache.get(kwargs.get('repo')): + obj = self._repo_cache.get(kwargs.get('repo')) + if obj: return obj repo: Repository = await func(self, *args, **kwargs) # type: ignore