Merge pull request #2894 from markparonyan/mypy-utils-zipfile-zstd

fix(typing): resolve mypy errors in utils.zipfile_zstd
This commit is contained in:
Jeremy Grossmann 2026-09-28 20:50:20 +02:00 committed by GitHub
commit 71965e0e81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 6 deletions

View File

@ -2,7 +2,7 @@
from . import _zipfile
from zipfile import *
from zipfile import (
from ._zipfile import (
ZIP_ZSTANDARD,
ZSTANDARD_VERSION,
)

View File

@ -1,13 +1,18 @@
import zipfile
import zipfile as _zipfile_module
import zstandard as zstd
import inspect
from typing import Any
from ._patcher import patch
zipfile: Any = _zipfile_module
zipfile.ZIP_ZSTANDARD = 93
ZIP_ZSTANDARD = 93
ZSTANDARD_VERSION = 20
zipfile.ZIP_ZSTANDARD = ZIP_ZSTANDARD
zipfile.compressor_names[zipfile.ZIP_ZSTANDARD] = "zstandard"
zipfile.ZSTANDARD_VERSION = 20
zipfile.ZSTANDARD_VERSION = ZSTANDARD_VERSION
@patch(zipfile, "_check_compression")

View File

@ -417,8 +417,6 @@ module = [
"gns3server.utils.images", # 4
"gns3server.utils.packet_filter_validation", # 16
"gns3server.utils.websocket_to_websocket", # 12
"gns3server.utils.zipfile_zstd", # 2
"gns3server.utils.zipfile_zstd._patcher", # 1
"gns3server.utils.zipfile_zstd._zipfile", # 5
]
ignore_errors = true