| 61 | |
| 62 | |
| 63 | class ZipFile2(zipfile.ZipFile): |
| 64 | # ZipFile and tarfile have slightly different APIs. Let's fix that. |
| 65 | def add(self, name: str, arcname: str) -> None: |
| 66 | return self.write(name, arcname) |
| 67 | |
| 68 | def __enter__(self) -> ZipFile2: |
| 69 | return self |
| 70 | |
| 71 | @property |
| 72 | def name(self) -> str: |
| 73 | assert self.filename |
| 74 | return self.filename |
| 75 | |
| 76 | |
| 77 | def archive(path: Path) -> tarfile.TarFile | ZipFile2: |
no outgoing calls
no test coverage detected
searching dependent graphs…