[Pyrex] Testing on Linux

Stefan Behnel behnel_ml at gkec.informatik.tu-darmstadt.de
Wed Apr 19 09:25:11 CEST 2006


Greg Ewing wrote:
> Considering this is the first time anyone has tried
> to run the tests on any other machine that I know of, it's
> not bad going!

Well, if you want more feedback, merge the Linux stuff into the next version.
Here's a little patch against the tgz I sent that should make it run on Python
versions before 2.4.

BTW, is there a way to regenerate the C files that are used for comparison? I
tried running the test suite on my modified Pyrex version and it goes off
complaining at almost any test that it found differences from the expected C
output.

Stefan


--- Pyrex/PC/LinuxSystem.py.orig        2006-04-19 08:07:40.000000000 +0200
+++ Pyrex/PC/LinuxSystem.py     2006-04-19 09:15:01.000000000 +0200
@@ -1,13 +1,14 @@
-import sys
+import os, sys
 from Pyrex.Utils import replace_suffix
 from Pyrex.Compiler.Errors import PyrexError

+def call(args):
+    return os.spawnvp(os.P_WAIT, args[0], args)

 class CCompilerError(PyrexError):
     pass

 def c_compile(c_file, verbose_flag=False, cplus=False, obj_suffix=".o"):
-    from subprocess import call
     out_file = replace_suffix(c_file, obj_suffix)
     version = sys.version_info[:2]
     args = [cplus and 'c++' or 'cc',
@@ -22,7 +23,6 @@
     return out_file

 def c_link(obj_file, verbose_flag=False, extra_objects=[], cplus=False):
-    from subprocess import call
     out_file = replace_suffix(obj_file, ".so")
     args = ['ld', '-shared', obj_file, '-o', out_file]
     if verbose_flag:




More information about the Pyrex mailing list