Commit ddb9facb authored by Gaetan Lepage's avatar Gaetan Lepage
Browse files

python3Packages.parfive: fix python 3.14 compatibility

parent 50a30fb1
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -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 ];
  };
}
})
+14 −0
Original line number Diff line number Diff line
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