# HG changeset patch # User Matt Harbison # Date 2023-01-05 22:02:02 # Node ID bcc45b33efb200fd869643970b234a2a000500ff # Parent de9ffb82ef4dd3950b8e102e8636fa69f9d2edef schemes: fix a broken check for drive letter conflicts Flagged by pytype locally. It appears to have regressed in 1863584f2fba (not yet released). This seems like an obvious typo- `dict.isalpha()` is nonsense. There's no crash though because `schemes` is pre-populated with 5 schemes (that are all now defunct), so the length of the dict is never 1, so it's impossible to abort. diff --git a/hgext/schemes.py b/hgext/schemes.py --- a/hgext/schemes.py +++ b/hgext/schemes.py @@ -135,7 +135,7 @@ schemes = { } -def _check_drive_letter(scheme): +def _check_drive_letter(scheme: bytes) -> None: """check if a scheme conflict with a Windows drive letter""" if ( pycompat.iswindows @@ -152,7 +152,7 @@ def extsetup(ui): schemes.update(dict(ui.configitems(b'schemes'))) t = templater.engine(templater.parse) for scheme, url in schemes.items(): - _check_drive_letter(schemes) + _check_drive_letter(scheme) url_scheme = urlutil.url(url).scheme if url_scheme in hg.peer_schemes: hg.peer_schemes[scheme] = ShortRepository(url, scheme, t)