Use unpacking

This commit is contained in:
Andrew Murray 2025-06-28 10:57:23 +10:00
parent a370209fea
commit ed82f4d235
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: