python3Packages.parfive: fix python 3.14 compatibility

This commit is contained in:
Gaetan Lepage
2026-01-21 16:14:36 +00:00
parent 50a30fb1ef
commit ddb9facbc7
2 changed files with 23 additions and 5 deletions
@@ -21,18 +21,22 @@
tqdm,
}:
buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "parfive";
version = "2.2.0";
pyproject = true;
src = fetchFromGitHub {
owner = "Cadair";
repo = "parfive";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-DIjS2q/SOrnLspomLHk8ZJ+krdzMyQfbIpXxad30s1k=";
};
pyproject = true;
patches = [
# SyntaxError: 'return' in a 'finally' block
./fix-python-3-14-compat.patch
];
build-system = [ setuptools-scm ];
@@ -72,8 +76,8 @@ buildPythonPackage rec {
description = "HTTP and FTP parallel file downloader";
mainProgram = "parfive";
homepage = "https://parfive.readthedocs.io/";
changelog = "https://github.com/Cadair/parfive/releases/tag/${src.tag}";
changelog = "https://github.com/Cadair/parfive/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.sarahec ];
};
}
})
@@ -0,0 +1,14 @@
diff --git a/parfive/downloader.py b/parfive/downloader.py
index 7a4116b..370ea78 100644
--- a/parfive/downloader.py
+++ b/parfive/downloader.py
@@ -317,8 +317,7 @@ class Downloader:
task.cancel()
dl_results = await asyncio.gather(*tasks, return_exceptions=True)
- finally:
- return self._format_results(dl_results, main_pb)
+ return self._format_results(dl_results, main_pb)
def _format_results(self, retvals, main_pb):
# Squash all nested lists into a single flat list