Files
nixpkgs/pkgs/development/python-modules/ecdsa/pr-371-fix-test-2026-05-23.patch
nicknb 32b789a802 python31{3,4}Packages.ecdsa: fix build failure
Python update caused one of the tests to fail. A patch that fixes this
has been submitted upstream, yet to be applied. This commit adds the
patch.

See https://github.com/tlsfuzzer/python-ecdsa/pull/371.
2026-05-23 15:44:36 +02:00

31 lines
866 B
Diff

From f8e0f3a0035b44fa2541e2c447ed1599f220c4b5 Mon Sep 17 00:00:00 2001
From: Alexander Shadchin <shadchin@yandex-team.com>
Date: Thu, 9 Apr 2026 12:22:29 +0300
Subject: [PATCH] Fix tests with new Python
---
src/ecdsa/der.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/ecdsa/der.py b/src/ecdsa/der.py
index 5d35d698..587d7852 100644
--- a/src/ecdsa/der.py
+++ b/src/ecdsa/der.py
@@ -464,12 +464,11 @@ def unpem(pem):
if isinstance(pem, text_type): # pragma: no branch
pem = pem.encode()
+ lines = (l.strip() for l in pem.split(b"\n"))
d = b"".join(
- [
- l.strip()
- for l in pem.split(b"\n")
- if l and not l.startswith(b"-----")
- ]
+ l
+ for l in lines
+ if l and not l.startswith(b"-----")
)
return base64.b64decode(d)