diff mercurial/statichttprepo.py @ 51303:81224afd938d

lock: properly convert error to bytes Flagged by pytype when a later changeset is applied moving typing comment to annotation. We fix this ahead of the annotation change to make sure pytype remains happy after the change. We have to do fairly crazy dance for pytype to be happy. This probably comes from the fact IOError.filename probably claims to be `str` while it is actually `bytes` if the filename raising that `IOError` is bytes. At the same time, `IOError.strerror` is consistently `str` and should be passed as `str` everywhere.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 20 Dec 2023 20:13:22 +0100
parents 3a2df812e1c7
children 0338fb200a30
line wrap: on
line diff
--- a/mercurial/statichttprepo.py	Wed Dec 20 12:51:20 2023 +0100
+++ b/mercurial/statichttprepo.py	Wed Dec 20 20:13:22 2023 +0100
@@ -243,7 +243,7 @@
     def wlock(self, wait=True):
         raise error.LockUnavailable(
             0,
-            _(b'lock not available'),
+            pycompat.sysstr(_(b'lock not available')),
             b'lock',
             _(b'cannot lock static-http repository'),
         )
@@ -251,7 +251,7 @@
     def lock(self, wait=True):
         raise error.LockUnavailable(
             0,
-            _(b'lock not available'),
+            pycompat.sysstr(_(b'lock not available')),
             b'lock',
             _(b'cannot lock static-http repository'),
         )