summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrgommers <ralf.gommers@googlemail.com>2011-06-02 18:48:26 +0200
committerrgommers <ralf.gommers@googlemail.com>2011-06-02 23:03:24 +0200
commitbf1e6f3e880362e8efda104b4e35645799232d65 (patch)
treefe8b12c2f51e4901fb6d0819f414c715e8aeda08
parent6441c2a788d0cc2a45c5e8a3ef0891ca4e42d96e (diff)
downloadnumpy-bf1e6f3e880362e8efda104b4e35645799232d65.tar.gz
ENH: distutils: do the correct thing when swig_opts is a string in setup.py
It should be a list, but until numpy 1.5.1 a string was accepted. This broke in 1.6.0, this commit unbreaks things. Closes #1851.
-rw-r--r--numpy/distutils/extension.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/distutils/extension.py b/numpy/distutils/extension.py
index 2db62969e..9f28263d8 100644
--- a/numpy/distutils/extension.py
+++ b/numpy/distutils/extension.py
@@ -48,6 +48,13 @@ class Extension(old_Extension):
# Python 2.4 distutils new features
self.swig_opts = swig_opts or []
+ # swig_opts is assumed to be a list. Here we handle the case where it
+ # is specified as a string instead.
+ if isinstance(self.swig_opts, basestring):
+ import warnings
+ msg = "swig_opts is specified as a string instead of a list"
+ warnings.warn(msg, SyntaxWarning)
+ self.swig_opts = self.swig_opts.split()
# Python 2.3 distutils new features
self.depends = depends or []