[py-svn] r41606 - py/trunk/py/green
fijal at codespeak.net
fijal at codespeak.net
Thu Mar 29 10:47:01 CEST 2007
Author: fijal
Date: Thu Mar 29 10:46:59 2007
New Revision: 41606
Modified:
py/trunk/py/green/greensock2.py
Log:
Rather strange hack to make sure that queue is not empty. Needed nowadays for
passing test_session in js/examples/console
Modified: py/trunk/py/green/greensock2.py
==============================================================================
--- py/trunk/py/green/greensock2.py (original)
+++ py/trunk/py/green/greensock2.py Thu Mar 29 10:46:59 2007
@@ -449,13 +449,17 @@
d = g_owtd[s]
#print 'owtd:', d[0]
# XXX: Check if d is non-empty
- g = d.popleft()
+ try:
+ g = d.popleft()
+ except IndexError:
+ g = None
if not d:
try:
del g_owtd[s]
except KeyError:
pass
- g.switch(g_owtd)
+ if g:
+ g.switch(g_owtd)
# if g.dead:
# check_waiters(g)
for s in iwtd:
@@ -463,13 +467,17 @@
d = g_iwtd[s]
#print 'iwtd:', d[0]
# XXX: Check if d is non-empty
- g = d.popleft()
+ try:
+ g = d.popleft()
+ except IndexError:
+ g = None
if not d:
try:
del g_iwtd[s]
except KeyError:
pass
- g.switch(g_iwtd)
+ if g:
+ g.switch(g_iwtd)
# if g.dead:
# check_waiters(g)
except GreenletExit:
More information about the py-svn
mailing list