Author: bugman Date: Fri Jul 29 10:06:14 2011 New Revision: 13984 URL: http://svn.gna.org/viewcvs/relax?rev=13984&view=rev Log: Fix for structure.read_pdb for when the file contains no PDB data. This is now caught, and a warning is given and the function exists cleanly. Modified: 1.3/generic_fns/structure/internal.py Modified: 1.3/generic_fns/structure/internal.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/internal.py?rev=13984&r1=13983&r2=13984&view=diff ============================================================================== --- 1.3/generic_fns/structure/internal.py (original) +++ 1.3/generic_fns/structure/internal.py Fri Jul 29 10:06:14 2011 @@ -826,6 +826,11 @@ # Increment the model index. model_index = model_index + 1 + # No data, so throw a warning and exit. + if not len(mol_conts): + warn(RelaxWarning("No structural data could be read from the file '%s'." % file_path)) + return False + # Create the structural data data structures. self.pack_structs(mol_conts, orig_model_num=orig_model_num, set_model_num=set_model_num, orig_mol_num=orig_mol_num, set_mol_name=new_mol_name, file_name=file, file_path=path)