瀏覽代碼

Catch ImportError rather than ModuleNotFoundError

In some cases, this is useful, e.g.:

ImportError: cannot import name 'replace_me' from 'dissolve' (unknown location)
Jelmer Vernooij 2 月之前
父節點
當前提交
1441b35f70
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dulwich/__init__.py

+ 1 - 1
dulwich/__init__.py

@@ -29,7 +29,7 @@ __all__ = ["replace_me"]
 
 try:
     from dissolve import replace_me
-except ModuleNotFoundError:
+except ImportError:
     # if dissolve is not installed, then just provide a basic implementation
     # of its replace_me decorator
     def replace_me(since=None, remove_in=None):