Skip to content

Commit afcd9d7

Browse files
committed
don't use lambdas as simple wrappers
1 parent 3a4704c commit afcd9d7

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/ecdsa/test_keys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,8 @@ def test_deterministic_sign_that_rises_S_zero_error(self):
769769
verifiers = []
770770
for modifier, fun in [
771771
("bytes", lambda x: x),
772-
("bytes memoryview", lambda x: buffer(x)),
773-
("bytearray", lambda x: bytearray(x)),
772+
("bytes memoryview", buffer),
773+
("bytearray", bytearray),
774774
("bytearray memoryview", lambda x: buffer(bytearray(x))),
775775
("array.array of bytes", lambda x: array.array("B", x)),
776776
("array.array of bytes memoryview", lambda x: buffer(array.array("B", x))),

src/ecdsa/test_malformed_sigs.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,13 @@ def st_der():
289289
| st_der_octet_string(max_size=1024**2)
290290
| st_der_null()
291291
| st_der_oid(),
292-
lambda children: st.builds(
293-
lambda x: encode_octet_string(x), st.one_of(children)
294-
)
292+
lambda children: st.builds(encode_octet_string, st.one_of(children))
295293
| st.builds(lambda x: encode_bitstring(x, 0), st.one_of(children))
296294
| st.builds(
297295
lambda x: encode_sequence(*x), st.lists(children, max_size=200)
298296
)
299297
| st.builds(
300-
lambda tag, x: encode_constructed(tag, x),
298+
encode_constructed,
301299
st.integers(min_value=0, max_value=0x3F),
302300
st.one_of(children),
303301
),

0 commit comments

Comments
 (0)