mailr2547 - /1.2/generic_fns/palmer.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 01, 2006 - 13:46:
Author: bugman
Date: Fri Sep  1 13:46:14 2006
New Revision: 2547

URL: http://svn.gna.org/viewcvs/relax?rev=2547&view=rev
Log:
Added a try statement to catch the ImportError failure of the 'spawnlp' 
function of the 'os' module.

This is a fix for bug #6841 
(https://gna.org/bugs/?func=detailitem&item_id=6841) which was reported
by Daniel Perez in the post at 
https://mail.gna.org/public/relax-users/2006-09/msg00000.html
(Message-id: <44F7FFCF.4060102@xxxxxxxxxxxxxxxx>).  The 'spawnlp' function 
problem was identified by
Chris MacRaild at 
https://mail.gna.org/public/relax-users/2006-09/msg00003.html (Message-id:
<1157109851.28764.964.camel@fbsdpcu021>).

This import statement fails under MS Windows as the 'spawnlp' function is 
UNIX only.


Modified:
    1.2/generic_fns/palmer.py

Modified: 1.2/generic_fns/palmer.py
URL: 
http://svn.gna.org/viewcvs/relax/1.2/generic_fns/palmer.py?rev=2547&r1=2546&r2=2547&view=diff
==============================================================================
--- 1.2/generic_fns/palmer.py (original)
+++ 1.2/generic_fns/palmer.py Fri Sep  1 13:46:14 2006
@@ -21,9 +21,15 @@
 
###############################################################################
 
 from math import pi
-from os import F_OK, P_WAIT, access, chdir, chmod, getcwd, listdir, remove, 
spawnlp, system
+from os import F_OK, P_WAIT, access, chdir, chmod, getcwd, listdir, remove, 
system
 from re import match, search
 from string import split
+
+# UNIX only functions from the os module (Modelfree4 only runs under UNIX 
anyway).
+try:
+    from os import spawnlp
+except ImportError:
+    pass
 
 
 class Palmer:




Related Messages


Powered by MHonArc, Updated Fri Sep 01 14:00:05 2006