Name top-level exceptions as private variables · gitpython-developers/GitPython@2a0305b

Original file line numberDiff line numberDiff line change

@@ -56,8 +56,8 @@ def _init_externals() -> None:

5656

Actor,

5757

rmtree,

5858

)

59-

except GitError as exc:

60-

raise ImportError("%s: %s" % (exc.__class__.__name__, exc)) from exc

59+

except GitError as _exc:

60+

raise ImportError("%s: %s" % (_exc.__class__.__name__, _exc)) from _exc

6161
6262

# } END imports

6363

@@ -87,6 +87,6 @@ def refresh(path: Optional[PathLike] = None) -> None:

8787

#################

8888

try:

8989

refresh()

90-

except Exception as exc:

91-

raise ImportError("Failed to initialize: {0}".format(exc)) from exc

90+

except Exception as _exc:

91+

raise ImportError("Failed to initialize: {0}".format(_exc)) from _exc

9292

#################