[Patches] [ python-Patches-664131 ] distutils config exe_extension on Mac OS X, Linux
SourceForge.net
noreply@sourceforge.net
Tue, 07 Jan 2003 18:14:02 -0800
Patches item #664131, was opened at 2003-01-08 11:14
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=664131&group_id=5470
Category: Distutils and setup.py
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Michiel de Hoon (mdehoon)
Assigned to: Nobody/Anonymous (nobody)
Summary: distutils config exe_extension on Mac OS X, Linux
Initial Comment:
I have been using distutils' "python setup.py config"
command in order to do some configuration steps before
the build and install.
On Linux and Mac OS X, when doing trial compilations I
get this error:
File
"/usr/local/lib/python2.3/distutils/command/config.py",
line 154, in _link
prog = prog + self.compiler.exe_extension
TypeError: cannot concatenate 'str' and 'NoneType' objects
The problem is that on Mac OS X and Linux,
self.compiler.exe_extension is None instead of "", and
Python doesn't allow None to be concatenated with a
string. The solution would be either to set
self.compiler.exe_extension to "" instead of None, or
to check if self.compiler.exe_extension is None before
concatenating. The attached patch does the latter:
if self.compiler.exe_extension:
prog = prog + self.compiler.exe_extension
Changing self.compiler.exe_extension to "" instead of
None may be a cleaner solution, but I don't know how
that would affect other parts of the distutils, which
is why I went with the solution above.
Michiel de Hoon (mdehoon@ims.u-tokyo.ac.jp)
University of Tokyo, Human Genome Center
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=664131&group_id=5470