mailr5555 - /1.3/generic_fns/state.py


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

Header


Content

Posted by edward on April 10, 2008 - 16:34:
Author: bugman
Date: Thu Apr 10 16:34:04 2008
New Revision: 5555

URL: http://svn.gna.org/viewcvs/relax?rev=5555&view=rev
Log:
load_state() now throws a RelaxError when the state is incompatible.

The error says that the relax version in incompatible.


Modified:
    1.3/generic_fns/state.py

Modified: 1.3/generic_fns/state.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/state.py?rev=5555&r1=5554&r2=5555&view=diff
==============================================================================
--- 1.3/generic_fns/state.py (original)
+++ 1.3/generic_fns/state.py Thu Apr 10 16:34:04 2008
@@ -25,6 +25,7 @@
 
 # relax module imports.
 from data import Data as relax_data_store
+from relax_errors import RelaxError
 from relax_io import open_read_file, open_write_file
 
 
@@ -41,7 +42,10 @@
     file = open_read_file(file_name=state, dir=dir_name)
 
     # Unpickle the data class.
-    state = load(file)
+    try:
+        state = load(file)
+    except:
+        raise RelaxError, "The saved state " + `state` + " is not compatible 
with this version of relax."
 
     # Close the file.
     file.close()




Related Messages


Powered by MHonArc, Updated Thu Apr 10 17:00:34 2008