changeset 49948:2ac60a71c240

typing: suppress a couple of attribute-errors in convert I thought these might be real issues, but they're not.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 06 Jan 2023 10:56:53 -0500
parents 5392bf258049
children 668fb0dcb179
files hgext/convert/hg.py hgext/convert/subversion.py
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/hg.py	Fri Jan 06 00:05:14 2023 -0500
+++ b/hgext/convert/hg.py	Fri Jan 06 10:56:53 2023 -0500
@@ -608,7 +608,10 @@
             files = copyfiles = ctx.manifest()
         if parents:
             if self._changescache[0] == rev:
-                ma, r = self._changescache[1]
+                # TODO: add type hints to avoid this warning, instead of
+                #  suppressing it:
+                #     No attribute '__iter__' on None [attribute-error]
+                ma, r = self._changescache[1]  # pytype: disable=attribute-error
             else:
                 ma, r = self._changedfiles(parents[0], ctx)
             if not full:
--- a/hgext/convert/subversion.py	Fri Jan 06 00:05:14 2023 -0500
+++ b/hgext/convert/subversion.py	Fri Jan 06 10:56:53 2023 -0500
@@ -725,7 +725,13 @@
     def getchanges(self, rev, full):
         # reuse cache from getchangedfiles
         if self._changescache[0] == rev and not full:
+            # TODO: add type hints to avoid this warning, instead of
+            #  suppressing it:
+            #     No attribute '__iter__' on None [attribute-error]
+
+            # pytype: disable=attribute-error
             (files, copies) = self._changescache[1]
+            # pytype: enable=attribute-error
         else:
             (files, copies) = self._getchanges(rev, full)
             # caller caches the result, so free it here to release memory