mailr20178 - /trunk/lib/io.py


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

Header


Content

Posted by edward on June 17, 2013 - 15:23:
Author: bugman
Date: Mon Jun 17 15:23:40 2013
New Revision: 20178

URL: http://svn.gna.org/viewcvs/relax?rev=20178&view=rev
Log:
The lib.io.open_write_file() function now catches file names of None and 
raises a RelaxError.

This is useful for the GUI if the user forgets to select a file name.


Modified:
    trunk/lib/io.py

Modified: trunk/lib/io.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/io.py?rev=20178&r1=20177&r2=20178&view=diff
==============================================================================
--- trunk/lib/io.py (original)
+++ trunk/lib/io.py Mon Jun 17 15:23:40 2013
@@ -397,6 +397,10 @@
     @rtype:                 writable file object (if return_path, then a 
tuple of the writable file
                             and the full file path)
     """
+
+    # No file name?
+    if file_name == None:
+        raise RelaxError("The name of the file must be supplied.")
 
     # A file descriptor object.
     if is_filetype(file_name):




Related Messages


Powered by MHonArc, Updated Mon Jun 17 15:40:02 2013