mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Avoid calling builtins.head on potentially-empty list
When no matching wheels are found, builtins.head causes this to fail with a very low-level error. Better to return an empty list and trigger the assertion in the code which calls this.
This commit is contained in:
parent
b7b50f4098
commit
e465c840f5
1 changed files with 2 additions and 2 deletions
|
@ -87,8 +87,8 @@ let
|
|||
let
|
||||
osxMatches = [ "10_12" "10_11" "10_10" "10_9" "any" ];
|
||||
linuxMatches = [ "manylinux1_" "manylinux2010_" "manylinux2014_" "any" ];
|
||||
chooseLinux = x: lib.singleton (builtins.head (findBestMatches linuxMatches x));
|
||||
chooseOSX = x: lib.singleton (builtins.head (findBestMatches osxMatches x));
|
||||
chooseLinux = x: lib.take 1 (findBestMatches linuxMatches x);
|
||||
chooseOSX = x: lib.take 1 (findBestMatches osxMatches x);
|
||||
in
|
||||
if isLinux
|
||||
then chooseLinux files
|
||||
|
|
Loading…
Add table
Reference in a new issue