comparison mercurial/posix.py @ 49810:a9faacdc5943

typing: add type hints to mercurial/win32.py These are the low level functions that are imported by the mercurial.windows module, which is in turn imported by mercurial.utils as the platform module. Pretty straightforward, but pytype inferred very little of it, likely because of the heavy ctypes usage. It also seems to trigger a pytype bug in procutil, now that it has an idea of the underlying function type, so disable that warning to maintain a working test.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 15 Dec 2022 18:02:55 -0500
parents 050dc8730858
children 0a91aba258e0
comparison
equal deleted inserted replaced
49809:7a80a614c9e5 49810:a9faacdc5943
623 """ 623 """
624 name = pycompat.fsdecode(name) 624 name = pycompat.fsdecode(name)
625 return pycompat.rapply(pycompat.fsencode, list(grp.getgrnam(name).gr_mem)) 625 return pycompat.rapply(pycompat.fsencode, list(grp.getgrnam(name).gr_mem))
626 626
627 627
628 def spawndetached(args): 628 def spawndetached(args) -> int:
629 return os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0), args[0], args) 629 return os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0), args[0], args)
630 630
631 631
632 def gethgcmd(): 632 def gethgcmd():
633 return sys.argv[:1] 633 return sys.argv[:1]