Skip to content

Commit ed82f4d

Browse files
committed
Use unpacking
1 parent a370209 commit ed82f4d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PIL/ImageMath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def unsafe_eval(
308308

309309
# build execution namespace
310310
args: dict[str, Any] = ops.copy()
311-
for k in list(options.keys()) + list(kw.keys()):
311+
for k in [*options, *kw]:
312312
if "__" in k or hasattr(builtins, k):
313313
msg = f"'{k}' not allowed"
314314
raise ValueError(msg)

src/PIL/McIdasImagePlugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _open(self) -> None:
4444
raise SyntaxError(msg)
4545

4646
self.area_descriptor_raw = s
47-
self.area_descriptor = w = [0] + list(struct.unpack("!64i", s))
47+
self.area_descriptor = w = [0, *struct.unpack("!64i", s)]
4848

4949
# get mode
5050
if w[11] == 1:

0 commit comments

Comments
 (0)