summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2017-12-10 20:10:35 +0000
committerOrivej Desh <orivej@gmx.fr>2017-12-10 20:10:35 +0000
commitc86b19cb20f68e6b65af6ac884940ea125e4a8f8 (patch)
tree6136eeddaa2bb5bad936242a1d9bc2532e7e7e6f /pkgs/top-level
parent9630bd52323e335c422d4da208590abb535fda43 (diff)
downloadnixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar
nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.gz
nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.bz2
nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.lz
nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.xz
nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.zst
nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.zip
Python: simplify hasPythonModule
Diffstat (limited to 'pkgs/top-level')
-rw-r--r--pkgs/top-level/python-packages.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index d164b80279bb..bcc1bcd7d6b6 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -87,12 +87,11 @@ let
     in fetcher (builtins.removeAttrs attrs ["format"]) );
 
   # Check whether a derivation provides a Python module.
-  hasPythonModule = drv: (hasAttr "pythonModule" drv) && ( (getAttr "pythonModule" drv) == python);
+  hasPythonModule = drv: drv?pythonModule && drv.pythonModule == python;
 
   # Get list of required Python modules given a list of derivations.
   requiredPythonModules = drvs: let
-    removeNull = list: filter (x: !isNull x) list;
-    modules = filter hasPythonModule (removeNull drvs);
+    modules = filter hasPythonModule drvs;
   in unique ([python] ++ modules ++ concatLists (catAttrs "requiredPythonModules" modules));
 
   # Create a PYTHONPATH from a list of derivations. This function recurses into the items to find derivations