[Updated] D11931: pytype: stop excluding ssutil.py
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Fri Dec 17 11:12:36 UTC 2021
Closed by commit rHG08af0adc235c: pytype: stop excluding ssutil.py (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11931?vs=31496&id=31524
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11931/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11931
AFFECTED FILES
mercurial/sslutil.py
tests/test-check-pytype.t
CHANGE DETAILS
diff --git a/tests/test-check-pytype.t b/tests/test-check-pytype.t
--- a/tests/test-check-pytype.t
+++ b/tests/test-check-pytype.t
@@ -27,7 +27,6 @@
mercurial/pure/osutil.py # [invalid-typevar], [not-callable]
mercurial/pure/parsers.py # [attribute-error]
mercurial/repoview.py # [attribute-error]
-mercurial/sslutil.py # [attribute-error]
mercurial/testing/storage.py # tons of [attribute-error]
mercurial/ui.py # [attribute-error], [wrong-arg-types]
mercurial/unionrepo.py # ui, svfs, unfiltered [attribute-error]
@@ -59,7 +58,6 @@
> -x mercurial/pure/osutil.py \
> -x mercurial/pure/parsers.py \
> -x mercurial/repoview.py \
- > -x mercurial/sslutil.py \
> -x mercurial/testing/storage.py \
> -x mercurial/thirdparty \
> -x mercurial/ui.py \
diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -139,12 +139,18 @@
alg, fingerprint = fingerprint.split(b':', 1)
fingerprint = fingerprint.replace(b':', b'').lower()
+ # pytype: disable=attribute-error
+ # `s` is heterogeneous, but this entry is always a list of tuples
s[b'certfingerprints'].append((alg, fingerprint))
+ # pytype: enable=attribute-error
# Fingerprints from [hostfingerprints] are always SHA-1.
for fingerprint in ui.configlist(b'hostfingerprints', bhostname):
fingerprint = fingerprint.replace(b':', b'').lower()
+ # pytype: disable=attribute-error
+ # `s` is heterogeneous, but this entry is always a list of tuples
s[b'certfingerprints'].append((b'sha1', fingerprint))
+ # pytype: enable=attribute-error
s[b'legacyfingerprint'] = True
# If a host cert fingerprint is defined, it is the only thing that
To: mharbison72, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211217/ef389547/attachment-0002.html>
More information about the Mercurial-patches
mailing list