diff --git a/spacy/cli/_util.py b/spacy/cli/_util.py index 757c418440..24573d7148 100644 --- a/spacy/cli/_util.py +++ b/spacy/cli/_util.py @@ -206,7 +206,7 @@ def get_git_version( """ try: ret = run_command("git --version", capture=True) - except: + except Exception: raise RuntimeError(error) stdout = ret.stdout.strip() if not stdout or not stdout.startswith("git version"): diff --git a/spacy/ml/callbacks.py b/spacy/ml/callbacks.py index d9976cea80..39ba8227db 100644 --- a/spacy/ml/callbacks.py +++ b/spacy/ml/callbacks.py @@ -90,7 +90,7 @@ def pipes_with_nvtx_range( # the original parameters are passed to pydantic for validation downstream. try: wrapped_func.__signature__ = inspect.signature(func) # type: ignore - except: + except Exception: # Can fail for Cython methods that do not have bindings. warnings.warn(Warnings.W122.format(method=name, pipe=pipe.name)) continue