From 5719f892e1139bae3a9c70bcc77fc1bc98cfb7ea Mon Sep 17 00:00:00 2001 From: Corbin Date: Mon, 4 Feb 2019 00:09:38 -0800 Subject: [PATCH] python: Make .isPyPy flag more accurate. nix-repl> map (s: s.isPyPy) [ python python3 pypy pypy3 ] [ false false true true ] --- lib/default.nix | 2 +- pkgs/development/interpreters/python/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 688c117d52b..8735b647679 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -81,7 +81,7 @@ let intersperse concatStringsSep concatMapStringsSep concatImapStringsSep makeSearchPath makeSearchPathOutput makeLibraryPath makeBinPath optionalString - hasPrefix hasSuffix stringToCharacters stringAsChars escape + hasInfix hasPrefix hasSuffix stringToCharacters stringAsChars escape escapeShellArg escapeShellArgs replaceChars lowerChars upperChars toLower toUpper addContextFrom splitString removePrefix removeSuffix versionOlder versionAtLeast getVersion diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 15af58be6fc..71aea332433 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -30,7 +30,7 @@ with pkgs; isPy2 = lib.strings.substring 0 1 pythonVersion == "2"; isPy3 = lib.strings.substring 0 1 pythonVersion == "3"; isPy3k = isPy3; - isPyPy = interpreter == "pypy"; + isPyPy = lib.hasInfix "pypy" interpreter; buildEnv = callPackage ./wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; }; withPackages = import ./with-packages.nix { inherit buildEnv pythonPackages;};