fix(typing): resolve mypy errors in utils.zipfile_zstd

This commit is contained in:
Mark Paronyan 2026-09-28 06:46:59 +00:00
parent 8df25dec32
commit 3fc1d27937
No known key found for this signature in database
GPG Key ID: 8DC7338A87FE22F8
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

@ -427,8 +427,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