diff --git a/dvc/repo/scm_context.py b/dvc/repo/scm_context.py index 61b8e8580..3103f4f6a 100644 --- a/dvc/repo/scm_context.py +++ b/dvc/repo/scm_context.py @@ -98,7 +98,7 @@ class SCMContext: @contextmanager def __call__( self, autostage: Optional[bool] = None, quiet: Optional[bool] = None - ) -> Iterator["SCMContext"]: + ) -> Iterator["Self"]: try: yield self except Exception: @@ -135,7 +135,8 @@ class SCMContext: def __enter__(self) -> "Self": self._cm = self() - return self._cm.__enter__() + self._cm.__enter__() + return self def __exit__(self, *exc_args) -> None: assert self._cm