summaryrefslogtreecommitdiff
path: root/Cython/Distutils
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2016-09-06 22:05:32 -0700
committerRobert Bradshaw <robertwb@gmail.com>2016-09-06 22:05:32 -0700
commit921479932fe6911897a82891168a060901aae76d (patch)
treebbe4809909fe8bab1ef26ffefb464019f55bbb76 /Cython/Distutils
parentd676b62b7a4d06632181c681d77983d5af01a495 (diff)
downloadcython-921479932fe6911897a82891168a060901aae76d.tar.gz
Suppress deprecation warning from setuptools import.
Diffstat (limited to 'Cython/Distutils')
-rw-r--r--Cython/Distutils/build_ext.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Cython/Distutils/build_ext.py b/Cython/Distutils/build_ext.py
index 024262ac3..6346bc940 100644
--- a/Cython/Distutils/build_ext.py
+++ b/Cython/Distutils/build_ext.py
@@ -7,6 +7,7 @@ building Cython extension modules."""
__revision__ = "$Id:$"
+import inspect
import sys
import os
from distutils.errors import DistutilsPlatformError
@@ -16,9 +17,14 @@ from distutils.command import build_ext as _build_ext
from distutils import sysconfig
import warnings
-warnings.warn(
- "Cython.Distutils.build_ext does not properly handle dependencies "
- "and is deprectated. Use Cython.Build.build_ext instead.")
+try:
+ from_setuptools = 'setuptools/extension.py' in inspect.getouterframes(inspect.currentframe(), 2)[2][1]
+except Exception:
+ from_setuptools = False
+if not from_setuptools:
+ warnings.warn(
+ "Cython.Distutils.build_ext does not properly handle dependencies "
+ "and is deprectated. Use Cython.Build.build_ext instead.")
try:
from __builtin__ import basestring