aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/py31compat.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-11-27 13:58:22 -0500
committerJason R. Coombs <jaraco@jaraco.com>2013-11-27 13:58:22 -0500
commit8a94f99bfbb19859aed1d96e5d169c80b51936d0 (patch)
tree04b4cbf4792833380e7595f266db5cfeb7ae29dc /setuptools/py31compat.py
parentbc47a75d4d97f34f9ad49a5142c351c74354cd41 (diff)
downloadexternal_python_setuptools-8a94f99bfbb19859aed1d96e5d169c80b51936d0.tar.gz
external_python_setuptools-8a94f99bfbb19859aed1d96e5d169c80b51936d0.tar.bz2
external_python_setuptools-8a94f99bfbb19859aed1d96e5d169c80b51936d0.zip
Extract py31compat module for get_config_vars and get_path
Diffstat (limited to 'setuptools/py31compat.py')
-rw-r--r--setuptools/py31compat.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/setuptools/py31compat.py b/setuptools/py31compat.py
new file mode 100644
index 00000000..dbb324b0
--- /dev/null
+++ b/setuptools/py31compat.py
@@ -0,0 +1,11 @@
+__all__ = ['get_config_vars', 'get_path']
+
+try:
+ # Python 2.7 or >=3.2
+ from sysconfig import get_config_vars, get_path
+except ImportError:
+ from distutils.sysconfig import get_config_vars, get_python_lib
+ def get_path(name):
+ if name not in ('platlib', 'purelib'):
+ raise ValueError("Name must be purelib or platlib")
+ return get_python_lib(name=='platlib')