This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: distutils config exe_extension on Mac OS X, Linux
Type: Stage:
Components: Distutils Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: jvr, mdehoon
Priority: normal Keywords: patch

Created on 2003-01-08 02:14 by mdehoon, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
config.py.diff mdehoon, 2003-01-08 02:17
Messages (2)
msg42364 - (view) Author: Michiel de Hoon (mdehoon) * Date: 2003-01-08 02:14
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
msg42365 - (view) Author: Just van Rossum (jvr) * (Python triager) Date: 2003-02-03 11:50
Logged In: YES 
user_id=92689

Apart from the tab character in the patch, this looks good. Checked in as rev. 1.16 of distutils/command/config.py
History
Date User Action Args
2022-04-10 16:06:07adminsetgithub: 37738
2003-01-08 02:14:02mdehooncreate