diff --git a/mercurial/lock.py b/mercurial/lock.py --- a/mercurial/lock.py +++ b/mercurial/lock.py @@ -204,7 +204,7 @@ def __del__(self): if self.held: - warnings.warn("use lock.release instead of del lock", + warnings.warn(r"use lock.release instead of del lock", category=DeprecationWarning, stacklevel=2)