[Pyrex] ANN: Pyrex 0.9.6

Alexander Belchenko bialix at ukr.net
Sun Oct 7 19:47:02 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lenard Lindstrom пишет:
> Alexander Belchenko wrote:
>> Greg, unfortunately new release breaks windows-compatibility.
>> When I try to build extensions in Bazaar sources tree I got exception:
>>
>> C:\work\Bazaar\mydev\bzr.dev>setup.py build_ext -i -f
>> running build_ext
>> pyrexing bzrlib/_dirstate_helpers_c.pyx to bzrlib/_dirstate_helpers_c.c
>> Traceback (most recent call last):
>>   File "C:\work\Bazaar\mydev\bzr.dev\setup.py", line 336, in <module>
>>     setup(**ARGS)
>>   File "C:\Python25\lib\distutils\core.py", line 151, in setup
>>     dist.run_commands()
>>   File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
>>     self.run_command(cmd)
>>   File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
>>     cmd_obj.run()
>>   File "C:\work\Bazaar\mydev\bzr.dev\setup.py", line 176, in run
>>     build_ext.run(self)
>>   File "C:\Python25\lib\distutils\command\build_ext.py", line 290, in run
>>     self.build_extensions()
>>   File "C:\Python25\Lib\site-packages\Pyrex\Distutils\build_ext.py", line 81, in build_extensions
>>     ext.sources = self.pyrex_sources(ext.sources, ext)
>>   File "C:\Python25\Lib\site-packages\Pyrex\Distutils\build_ext.py", line 179, in pyrex_sources
>>     result = pyrex_compile(source, options=options)
>>   File "C:\Python25\Lib\site-packages\Pyrex\Compiler\Main.py", line 290, in compile
>>     return context.compile(source, options)
>>   File "C:\Python25\Lib\site-packages\Pyrex\Compiler\Main.py", line 188, in compile
>>     tree = self.parse(source, scope.type_names, pxd = 0)
>>   File "C:\Python25\Lib\site-packages\Pyrex\Compiler\Main.py", line 140, in parse
>>     type_names = type_names, context = self)
>>   File "C:\Python25\Lib\site-packages\Pyrex\Compiler\Scanning.py", line 226, in __init__
>>     self.compile_time_env = initial_compile_time_env()
>>   File "C:\Python25\Lib\site-packages\Pyrex\Compiler\Scanning.py", line 190, in initial_compile_time_env
>>     for name, value in zip(names, os.uname()):
>> AttributeError: 'module' object has no attribute 'uname'
>>
>>   
> 
> Possibly the intended function is platform.uname(). It became available 
> in Python 2.3 and is cross platform.

Changing to platform.uname helps me. Here is the patch:

=== modified file 'Pyrex/Compiler/Scanning.py'
- --- Pyrex/Compiler/Scanning.py  2007-10-07 17:40:40 +0000
+++ Pyrex/Compiler/Scanning.py  2007-10-07 17:42:51 +0000
@@ -187,7 +187,8 @@
     benv = CompileTimeScope()
     names = ('UNAME_SYSNAME', 'UNAME_NODENAME', 'UNAME_RELEASE',
         'UNAME_VERSION', 'UNAME_MACHINE')
- -    for name, value in zip(names, os.uname()):
+    import platform
+    for name, value in zip(names, platform.uname()):
         benv.declare(name, value)
     import __builtin__
     names = ('False', 'True',

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHCRuWzYr338mxwCURAsrUAKCT8QwZLpjI0b9apY0GxtCgDan+ywCfWLlZ
hg+Gum7PKuxywUK6XF7HSgI=
=M+dv
-----END PGP SIGNATURE-----




More information about the Pyrex mailing list