473,461 Members | 1,672 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pyrex-0.9.3: definition mismatch with distutils of Python24

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


Jul 18 '05 #1
1 3558
mb@muenster.de (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
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Gary Stephenson | last post by:
I'm getting a clean generate, compile and link from my .pyx script, but when I attempt to run the resultant .exe, I get: "The procedure entry point Py_NoneStruct could not be located in the...
10
by: Kyler Laird | last post by:
I need to submit C/C++ code for a class. (It's not a programming class. The choice of language is inertial. I think that it mostly serves to distract students from the course subject.) I'm...
1
by: Paul Prescod | last post by:
PyCon 2004 Slides on "Extending Python with Pyrex" PDF: http://www.prescod.net/pyrex/ExtendingPythonWithPyrex.pdf PPT: http://www.prescod.net/pyrex/ExtendingPythonWithPyrex.ppt Pycon 2004 Slides...
4
by: Kyler Laird | last post by:
I mentioned earlier that I started using Pyrex because I'm taking a computer vision course that requires all assignments to be submitted as C(++). While I could write C it would hurt me to do so...
6
by: SeeBelow | last post by:
I just read "about Pyrex" at http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/version/Doc/About.html It seems that it is not compiled into machine code, as C would be, and therefore it does...
4
by: Carl | last post by:
I have recently started to use Pyrex and am amazed by it's useability. Are there any alternatives to Pyrex? One thing that I haven't figured out is how to embed pure C/C++ source code into...
27
by: Julien Fiore | last post by:
Do you wand to install Pyrex on Windows ? Here is a step-by-step guide explaining: A) how to install Pyrex on Windows XP. B) how to compile a Pyrex module. Julien Fiore, U. of Geneva
11
by: Jim Lewis | last post by:
Has anyone found a good link on exactly how to speed up code using pyrex? I found various info but the focus is usually not on code speedup.
7
by: Jim Lewis | last post by:
I'm trying to move a function into pyrex for speed. The python side needs to pass a list to the pyrex function. Do I need to convert to array or something so pyrex can generate tight code? I'm not...
3
by: skip | last post by:
I'm using Pyrex 0.9.5.1a. I have this simple Pyrex module: cdef class Foo: cdef public char attr def __init__(self): self.attr = 0 class Bar(Foo): def __init__(self):
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.