Use unpacking (#9044)

This commit is contained in:
Hugo van Kemenade 2025-06-28 14:33:10 +03:00 committed by GitHub
commit c084bd7d95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -308,7 +308,7 @@ def unsafe_eval(
# build execution namespace
args: dict[str, Any] = ops.copy()
for k in list(options.keys()) + list(kw.keys()):
for k in [*options, *kw]:
if "__" in k or hasattr(builtins, k):
msg = f"'{k}' not allowed"
raise ValueError(msg)

View File

@ -44,7 +44,7 @@ class McIdasImageFile(ImageFile.ImageFile):
raise SyntaxError(msg)
self.area_descriptor_raw = s
self.area_descriptor = w = [0] + list(struct.unpack("!64i", s))
self.area_descriptor = w = [0, *struct.unpack("!64i", s)]
# get mode
if w[11] == 1: