python31{3,4}Packages.ecdsa: fix build failure (#523363)

This commit is contained in:
Sandro 2026-05-24 11:15:08 +00:00 committed by GitHub
commit a0fc42282c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 0 deletions

View file

@ -34,6 +34,13 @@ buildPythonPackage (finalAttrs: {
pytestCheckHook
];
patches = [
# Python update caused one of the tests to fail. A patch that fixes this
# has been submitted upstream, yet to be applied.
# https://github.com/tlsfuzzer/python-ecdsa/pull/371
./pr-371-fix-test-2026-05-23.patch
];
passthru.updateScript = gitUpdater {
rev-prefix = "python-ecdsa-";
};

View file

@ -0,0 +1,30 @@
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)