Author: dmeyer
Date: Wed Feb 28 21:57:50 2007
New Revision: 2531

Modified:
   trunk/base/src/notifier/yieldfunc.py

Log:
handle StopIteration on first call

Modified: trunk/base/src/notifier/yieldfunc.py
==============================================================================
--- trunk/base/src/notifier/yieldfunc.py        (original)
+++ trunk/base/src/notifier/yieldfunc.py        Wed Feb 28 21:57:50 2007
@@ -128,7 +128,11 @@
 
         def newfunc(*args, **kwargs):
             function = func(*args, **kwargs).next
-            result = function()
+            try:
+                result = function()
+            except StopIteration:
+                # no return with yield, but done, return None
+                return None
             if not (result == YieldContinue or \
                     isinstance(result, (YieldCallback, InProgress))):
                 # everything went fine, return result

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to