comparison mercurial/windows.py @ 51716:e618a1756b08

typing: avoid some useless @overload definitions in `mercurial.util` Apparently pytype considered the name as well as the type of each argument, and generates @overload definitions if they don't match. At best this is clutter, and can easily be removed.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 19 Jul 2024 16:38:53 -0400
parents f3b34386d3e0
children 1888846a1ee2
comparison
equal deleted inserted replaced
51715:7558cee89655 51716:e618a1756b08
618 618
619 If gid is None, return the name of the current group.""" 619 If gid is None, return the name of the current group."""
620 return None 620 return None
621 621
622 622
623 def readlink(pathname: bytes) -> bytes: 623 def readlink(path: bytes) -> bytes:
624 path = pycompat.fsdecode(pathname) 624 path_str = pycompat.fsdecode(path)
625 try: 625 try:
626 link = os.readlink(path) 626 link = os.readlink(path_str)
627 except ValueError as e: 627 except ValueError as e:
628 # On py2, os.readlink() raises an AttributeError since it is 628 # On py2, os.readlink() raises an AttributeError since it is
629 # unsupported. On py3, reading a non-link raises a ValueError. Simply 629 # unsupported. On py3, reading a non-link raises a ValueError. Simply
630 # treat this as the error the locking code has been expecting up to now 630 # treat this as the error the locking code has been expecting up to now
631 # until an effort can be made to enable symlink support on Windows. 631 # until an effort can be made to enable symlink support on Windows.