mercurial/utils/procutil.py
changeset 49810 a9faacdc5943
parent 49793 8147abc05794
child 50926 18c8c18993f0
--- a/mercurial/utils/procutil.py	Thu Dec 15 15:46:25 2022 -0500
+++ b/mercurial/utils/procutil.py	Thu Dec 15 18:02:55 2022 -0500
@@ -585,7 +585,7 @@
     return _gethgcmd()
 
 
-def rundetached(args, condfn):
+def rundetached(args, condfn) -> int:
     """Execute the argument list in a detached process.
 
     condfn is a callable which is called repeatedly and should return
@@ -621,6 +621,12 @@
         if prevhandler is not None:
             signal.signal(signal.SIGCHLD, prevhandler)
 
+        # pytype seems to get confused by not having a return in the finally
+        # block, and thinks the return value should be Optional[int] here.  It
+        # appears to be https://github.com/google/pytype/issues/938, without
+        # the `with` clause.
+        pass  # pytype: disable=bad-return-type
+
 
 @contextlib.contextmanager
 def uninterruptible(warn):