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.

Author stefan
Recipients dstufft, eric.araujo, stefan
Date 2016-01-07.00:32:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452126768.68.0.403890898516.issue26033@psf.upfronthosting.co.za>
In-reply-to
Content
I'm trying to use the distutil compiler to preprocess some header (to be used with the cffi package).
The code is

    compiler = distutils.ccompiler.new_compiler()
    compiler.add_include_dir(join(sys.prefix, 'include'))
    compiler.preprocess(source)

This raises this exception (on Linux):

  File ".../distutils/unixccompiler.py", line 88, in preprocess
    pp_args = self.preprocessor + pp_opts
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

caused by 'set.preprocessor' to be set to None (with the preceding comment:

    # The defaults here
    # are pretty generic; they will probably have to be set by an outsider
    # (eg. using information discovered by the sysconfig about building
    # Python extensions).

Seems that code never got fully implemented.
Further, the MSVC version of the compiler (msvccompiler.py) doesn't even implement a "preprocess()" method, so this falls back to the CCompiler.preprocess() default, which does nothing !
History
Date User Action Args
2016-01-07 00:32:48stefansetrecipients: + stefan, eric.araujo, dstufft
2016-01-07 00:32:48stefansetmessageid: <1452126768.68.0.403890898516.issue26033@psf.upfronthosting.co.za>
2016-01-07 00:32:48stefanlinkissue26033 messages
2016-01-07 00:32:48stefancreate