Skip to content

Commit dce8def

Browse files
committed
Switch to dict.popitem()
1 parent 5e5cf4f commit dce8def

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The table below shows which release corresponds to each branch, and what date th
7777
- [#2327][2327] Add basic support to debug processes on Windows
7878
- [#2322][2322] Add basic RISCV64 shellcraft support
7979
- [#2330][2330] Change `context.newline` when setting `context.os` to `"windows"`
80-
- [#2391][2391] Change from `pop` to `keys` for reporting proper error message
80+
- [#2391][2391] Fix error message when passing invalid kwargs to `xor`
8181

8282
[2360]: https://github.com/Gallopsled/pwntools/pull/2360
8383
[2356]: https://github.com/Gallopsled/pwntools/pull/2356

pwnlib/util/fiddling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def xor(*args, **kwargs):
332332
cut = kwargs.pop('cut', 'max')
333333

334334
if kwargs != {}:
335-
raise TypeError("xor() got an unexpected keyword argument '%s'" % list(kwargs.keys())[0])
335+
raise TypeError("xor() got an unexpected keyword argument '%s'" % kwargs.popitem()[0])
336336

337337
if len(args) == 0:
338338
raise ValueError("Must have something to xor")

0 commit comments

Comments
 (0)