Patchwork D7288: archival: suppress some incorrect pytype failures

login
register
mail settings
Submitter phabricator
Date Nov. 7, 2019, 8:35 a.m.
Message ID <0b899ddf09fd80889a51263692bfd458@localhost.localdomain>
Download mbox | patch
Permalink /patch/42882/
State Not Applicable
Headers show

Comments

phabricator - Nov. 7, 2019, 8:35 a.m.
Closed by commit rHGd5bef33ab83c: archival: suppress some incorrect pytype failures (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7288?vs=17658&id=17702

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7288/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7288

AFFECTED FILES
  mercurial/archival.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -154,9 +154,11 @@ 
                 fname = fname[:-3]
             flags = 0
             if fname:
-                flags = gzip.FNAME
+                flags = gzip.FNAME  # pytype: disable=module-attr
             self.fileobj.write(pycompat.bytechr(flags))
-            gzip.write32u(self.fileobj, int(self.timestamp))
+            gzip.write32u(  # pytype: disable=module-attr
+                self.fileobj, int(self.timestamp)
+            )
             self.fileobj.write(b'\002')
             self.fileobj.write(b'\377')
             if fname:
@@ -179,7 +181,7 @@ 
                     timestamp=mtime,
                 )
                 self.fileobj = gzfileobj
-                return tarfile.TarFile.taropen(
+                return tarfile.TarFile.taropen(  # pytype: disable=attribute-error
                     name, pycompat.sysstr(mode), gzfileobj
                 )
             else:
@@ -234,7 +236,7 @@ 
 
     def addfile(self, name, mode, islink, data):
         i = zipfile.ZipInfo(pycompat.fsdecode(name), self.date_time)
-        i.compress_type = self.z.compression
+        i.compress_type = self.z.compression  # pytype: disable=attribute-error
         # unzip will not honor unix file modes unless file creator is
         # set to unix (id 3).
         i.create_system = 3