[Pyrex] Newbie question

len-l at telus.net len-l at telus.net
Fri Jul 1 01:07:02 CEST 2005


On 30 Jun 2005 at 13:29, len-l at telus.net wrote:

> On 30 Jun 2005 at 8:57, philippe at philippecmartin.com wrote:
> 
> [snip]
> > Q2) I am trying to make in "Pyrex-0.9.3/Demos" and am getting the following 
> > errors - anything obvious ?
> > 
> > PS: I'm under Linux MDK 10.1
> > 
> > Thanks,
> > 
> > Philippe
> > ***********************
> > [root at pcmsc Demos]# make all
> > python Setup.py build_ext --inplace
> > running build_ext
> > building 'primes' extension
> > Traceback (most recent call last):
> >   File "Setup.py", line 12, in ?
> >     cmdclass = {'build_ext': build_ext}
> >   File "/usr/lib/python2.4/distutils/core.py", line 149, in setup
> >     dist.run_commands()
> >   File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands
> >     self.run_command(cmd)
> >   File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
> >     cmd_obj.run()
> >   File "/usr/lib/python2.4/distutils/command/build_ext.py", line 279, in run
> >     self.build_extensions()
> >   File "/usr/lib/python2.4/distutils/command/build_ext.py", line 405, in 
> > build_extensions
> >     self.build_extension(ext)
> >   File "/usr/lib/python2.4/distutils/command/build_ext.py", line 442, in 
> > build_extension
> >     sources = self.swig_sources(sources, ext)
> > TypeError: swig_sources() takes exactly 2 arguments (3 given)
> > -- 
> 
> The problem is with an incompatibilty with the Pyrex 0.9.3 build_ext and the Python 
> 2.4 disutils library. For now I first compile the pyrex module to C using pyrexc.py, 
> then compile the resulting C module (primes.c in the above case) using disutils, no 
> build_ext.
> 

Here is a patch that should fix the problem. It is even backwards compatible with 
Python 2.3.  Apply it to lib/python2.4/site-packages/Pyrex/Distutils/build_ext.py .
On Windows it is Python2.4\Lib\site-packages\Pyrex\Distutils\build_ext.py .

35c35
<   def swig_sources (self, sources):
---
>   def swig_sources (self, sources, extension=None):

Lenard Lindstrom
<len-l at telus.net>




More information about the Pyrex mailing list