summaryrefslogtreecommitdiff
path: root/cffi/setuptools_ext.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2019-02-16 13:13:49 +0100
committerArmin Rigo <arigo@tunes.org>2019-02-16 13:13:49 +0100
commit798b5dfcfd9dfa826e4ed88a80e52043d31bfdab (patch)
treeaf75ee838b90a4938eb685926899d1194f2a4a2d /cffi/setuptools_ext.py
parentcb069bdcb6d4fde6e57008203e4c5abf5f1766dd (diff)
downloadcffi-798b5dfcfd9dfa826e4ed88a80e52043d31bfdab.tar.gz
On Windows, we still can't use Py_LIMITED_API for bad reasons.
Diffstat (limited to 'cffi/setuptools_ext.py')
-rw-r--r--cffi/setuptools_ext.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/cffi/setuptools_ext.py b/cffi/setuptools_ext.py
index a6eb8b8..df5a518 100644
--- a/cffi/setuptools_ext.py
+++ b/cffi/setuptools_ext.py
@@ -81,8 +81,14 @@ def _set_py_limited_api(Extension, kwds):
it doesn't so far, creating troubles. That's why we check
for "not hasattr(sys, 'gettotalrefcount')" (the 2.7 compatible equivalent
of 'd' not in sys.abiflags). (http://bugs.python.org/issue28401)
+
+ On Windows, with CPython <= 3.4, it's better not to use py_limited_api
+ because virtualenv *still* doesn't copy PYTHON3.DLL on these versions.
+ For now we'll skip py_limited_api on all Windows versions to avoid an
+ inconsistent mess.
"""
- if 'py_limited_api' not in kwds and not hasattr(sys, 'gettotalrefcount'):
+ if ('py_limited_api' not in kwds and not hasattr(sys, 'gettotalrefcount')
+ and sys.platform != 'win32'):
import setuptools
try:
setuptools_major_version = int(setuptools.__version__.partition('.')[0])