From 837cf416cee05e1651ae56ef9b65454645497d8d Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 17 Aug 2016 06:18:07 +0300 Subject: [PATCH] wrapPythonProgram: exclude Python itself from PYTHONPATH --- pkgs/development/python-modules/generic/wrap.sh | 2 ++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh index f4b2d44993ca..ca73a473ed56 100644 --- a/pkgs/development/python-modules/generic/wrap.sh +++ b/pkgs/development/python-modules/generic/wrap.sh @@ -17,6 +17,8 @@ buildPythonPath() { declare -A pythonPathsSeen=() program_PYTHONPATH= program_PATH= + pythonPathsSeen["@python@"]=1 + addToSearchPath program_PATH @python@/bin for path in $pythonPath; do _addToPythonPath $path done diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2674da51f777..9e04f3c459c8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -42,6 +42,7 @@ in modules // { { deps = pkgs.makeWrapper; substitutions.libPrefix = python.libPrefix; substitutions.executable = python.interpreter; + substitutions.python = python; substitutions.magicalSedExpression = let # Looks weird? Of course, it's between single quoted shell strings. # NOTE: Order DOES matter here, so single character quotes need to be