Author: ianb
Date: 2006-02-01 09:22:31 -0700 (Wed, 01 Feb 2006)
New Revision: 1556

Modified:
   FormEncode/trunk/formencode/foreach.py
Log:
Don't worry about missing attribute when deleting full_list and index from the 
state on cleanup

Modified: FormEncode/trunk/formencode/foreach.py
===================================================================
--- FormEncode/trunk/formencode/foreach.py      2006-01-31 15:43:56 UTC (rev 
1555)
+++ FormEncode/trunk/formencode/foreach.py      2006-02-01 16:22:31 UTC (rev 
1556)
@@ -95,11 +95,17 @@
         finally:
             if state is not None:
                 if previous_index is NoDefault:
-                    del state.index
+                    try:
+                        del state.index
+                    except AttributeError:
+                        pass
                 else:
                     state.index = previous_index
                 if previous_full_list is NoDefault:
-                    del state.full_list
+                    try:
+                        del state.full_list
+                    except AttributeError:
+                        pass
                 else:
                     state.full_list = previous_full_list
 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs

Reply via email to