about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-07-13 23:20:04 +0000
committerAlyssa Ross <hi@alyssa.is>2020-07-13 23:21:06 +0000
commita42c1d6d62656dcf9bd85de620f2e200a5ad22d8 (patch)
tree7d481fea9872f62a034452612be17f4494159baa /nixpkgs/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch
parent55f69a6b0e53c1c4b3e0396937c53bf5662b5519 (diff)
parent9480bae337095fd24f61380bce3174fdfe926a00 (diff)
downloadnixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.gz
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.bz2
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.lz
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.xz
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.zst
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.zip
Merge commit '9480bae337095fd24f61380bce3174fdfe926a00'
This is the last nixos-unstable release before 13b2903169f, which I'm a
bit nervous about.  So I want the update including that one to be as
small as possible, hence going to this one first.
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch')
-rw-r--r--nixpkgs/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch b/nixpkgs/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch
new file mode 100644
index 000000000000..2b34da289e2d
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch
@@ -0,0 +1,37 @@
+From 21563405d6e2348ee457187f7fb61beb102bb367 Mon Sep 17 00:00:00 2001
+From: Frederik Rietdijk <fridh@fridh.nl>
+Date: Sun, 24 May 2020 09:33:13 +0200
+Subject: [PATCH] Check base_prefix and base_exec_prefix for Python 2
+
+This is a Nixpkgs-specific change so it can support virtualenvs from Nix envs.
+---
+ src/virtualenv/discovery/py_info.py | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/virtualenv/discovery/py_info.py b/src/virtualenv/discovery/py_info.py
+index 6f12128..74e9218 100644
+--- a/src/virtualenv/discovery/py_info.py
++++ b/src/virtualenv/discovery/py_info.py
+@@ -51,13 +51,17 @@ class PythonInfo(object):
+         self.version = u(sys.version)
+         self.os = u(os.name)
+ 
++        config_vars = {} if sys.version_info.major is not 2 else sysconfig._CONFIG_VARS
++        base_prefix = config_vars.get("prefix")
++        base_exec_prefix = config_vars.get("exec_prefix")
++
+         # information about the prefix - determines python home
+         self.prefix = u(abs_path(getattr(sys, "prefix", None)))  # prefix we think
+-        self.base_prefix = u(abs_path(getattr(sys, "base_prefix", None)))  # venv
++        self.base_prefix = u(abs_path(getattr(sys, "base_prefix", base_prefix)))  # venv
+         self.real_prefix = u(abs_path(getattr(sys, "real_prefix", None)))  # old virtualenv
+ 
+         # information about the exec prefix - dynamic stdlib modules
+-        self.base_exec_prefix = u(abs_path(getattr(sys, "base_exec_prefix", None)))
++        self.base_exec_prefix = u(abs_path(getattr(sys, "base_exec_prefix", base_exec_prefix)))
+         self.exec_prefix = u(abs_path(getattr(sys, "exec_prefix", None)))
+ 
+         self.executable = u(abs_path(sys.executable))  # the executable we were invoked via
+-- 
+2.25.1
+