diff options
author | Torsten Landschoff <torsten.landschoff@scale.eu> | 2016-08-20 09:23:24 +0200 |
---|---|---|
committer | Torsten Landschoff <torsten.landschoff@scale.eu> | 2016-08-20 09:23:24 +0200 |
commit | d687531884ee25d5a517d529b2fd535831b70115 (patch) | |
tree | b4496091e350cac3d74d3dd4c45feb5ae0322914 /setuptools/extension.py | |
parent | e3ffde678c36ca778476574194cdc6d436d82263 (diff) | |
download | external_python_setuptools-d687531884ee25d5a517d529b2fd535831b70115.tar.gz external_python_setuptools-d687531884ee25d5a517d529b2fd535831b70115.tar.bz2 external_python_setuptools-d687531884ee25d5a517d529b2fd535831b70115.zip |
Make Extension accept positional arguments again (fixes #752).
As a side effect, py_limited_api may now only be passed as keyword
argument. I think it is early enough for this feature to change this
and enforce the flag to be passed as a keyword...
Diffstat (limited to 'setuptools/extension.py')
-rw-r--r-- | setuptools/extension.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/setuptools/extension.py b/setuptools/extension.py index da94c3fa..f8058b72 100644 --- a/setuptools/extension.py +++ b/setuptools/extension.py @@ -36,9 +36,11 @@ have_pyrex = _have_cython class Extension(_Extension): """Extension that uses '.c' files in place of '.pyx' files""" - def __init__(self, name, sources, py_limited_api=False, **kw): - self.py_limited_api = py_limited_api - _Extension.__init__(self, name, sources, **kw) + def __init__(self, name, sources, *args, **kw): + # The *args is needed for compatibility as calls may use positional + # arguments. py_limited_api may be set only via keyword. + self.py_limited_api = kw.pop("py_limited_api", False) + _Extension.__init__(self, name, sources, *args, **kw) def _convert_pyx_sources_to_lang(self): """ |