Pyrex-0.9.3: definition mismatch with distutils of Python24

Martin Bless mb at
Thu Jan 13 16:35:51 EST 2005

Now that I've got my extension building machine using the VC++ Toolkit
2003 up and running I'm keen on using Pyrex (Pyrex-0.9.3,

But the definition of the swig_sources() method seems to have changed.

When I try to build the examples from Pyrex I get a TypeError:

c:\Pyrex-0.9.3\Demos> python build_ext --inplace
running build_ext
building 'primes' extension
  File "C:\Python24\lib\distutils\command\", line 442, in
    sources = self.swig_sources(sources, ext)
TypeError: swig_sources() takes exactly 2 arguments (3 given)

I can see that subclasses
distutils.command.build_ext.build_ext, and the number of arguments of
the swig_sources method seems to have changed.

Pyrex uses:

  def swig_sources (self, sources):

whereas the distutils use:

  def swig_sources (self, sources, extension):

If I just add the "extension" arg to the Pyrex definitions everything
seems to work. But I have to admit that I don't really know what I'm
doing here and I feel sorry I can't contribute more than just
reporting the error.

mb - Martin Bless

More information about the Python-list mailing list