From bf1e6f3e880362e8efda104b4e35645799232d65 Mon Sep 17 00:00:00 2001 From: rgommers Date: Thu, 2 Jun 2011 18:48:26 +0200 Subject: 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. --- numpy/distutils/extension.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'numpy/distutils') 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 [] -- cgit v1.2.1