aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/py31compat.py
diff options
context:
space:
mode:
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')