From 43548a1ac9947297575d8a28ebeec61a508237b6 2022-02-04 08:13:54 From: Ben Sturmfels Date: 2022-02-04 08:13:54 Subject: [PATCH] config: Fix mypy error for git.exc. Error was: conservancy_beancount/config.py:142: error: Trying to read deleted variable "exc" Not entirely sure what's causing this, but since GitPython also imports the exceptions at the root of the package with "from git.exc import *", we can import them from there instead, which seems to appease mypy. --- diff --git a/conservancy_beancount/config.py b/conservancy_beancount/config.py index 95d763e5461cc66effb3febee5e5a803d8672b0d..3f15a2504d6418e5d0f6cb90b5bea9047bc68cb2 100644 --- a/conservancy_beancount/config.py +++ b/conservancy_beancount/config.py @@ -139,7 +139,7 @@ class Config: """ try: return git.Repo(self.file_config['Beancount']['books dir']) - except (KeyError, git.exc.GitError): + except (KeyError, git.GitError): return None def cache_dir_path(self, name: str='conservancy_beancount') -> Optional[Path]: