Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Pyrex-0.9.3: definition mismatch with distutils of Python24

Reply
Thread Tools

Pyrex-0.9.3: definition mismatch with distutils of Python24

 
 
Martin Bless
Guest
Posts: n/a
 
      01-13-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,
Python-2.4.0).

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 Setup.py build_ext --inplace
running build_ext
building 'primes' extension
[...]
File "C:\Python24\lib\distutils\command\build_ext.p y", line 442, in
build_extension
sources = self.swig_sources(sources, ext)
TypeError: swig_sources() takes exactly 2 arguments (3 given)


I can see that Pyrex.Distutils.build_ext.py 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




 
Reply With Quote
 
 
 
 
David M. Cooke
Guest
Posts: n/a
 
      01-14-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) (Martin Bless) writes:

> 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,
> Python-2.4.0).
>
> 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 Setup.py build_ext --inplace
> running build_ext
> building 'primes' extension
> [...]
> File "C:\Python24\lib\distutils\command\build_ext.p y", line 442, in
> build_extension
> sources = self.swig_sources(sources, ext)
> TypeError: swig_sources() takes exactly 2 arguments (3 given)
>
>
> I can see that Pyrex.Distutils.build_ext.py 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.


Yep, that's it. Greg must know now, it's been reported a few times.
You'll want to change it to

def swig_sources(self, sources, extension=None):

so that if you use an older python it won't complain about missing
arguments.

--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
distutils, No module named numpy.distutils.fcompiler.conv_template Luis Alberto Zarrabeitia Gomez Python 0 03-30-2009 03:56 PM
distutils crashing: $MACOSX_DEPLOYMENT_TARGET mismatch Justin S Bayer Python 0 03-26-2008 07:39 PM
can distutils windows installer invoke another distutils windows installer timw.google Python 1 05-11-2006 10:07 PM
RE: How big is python24.dll? Delaney, Timothy C (Timothy) Python 12 07-14-2004 08:21 PM
How big is python24.dll? A. B., Khalid Python 5 07-13-2004 06:35 AM



Advertisments