1
0
forked from VimPlug/jedi

fix generator tests (multiple yields must be called with an if random.

This commit is contained in:
Dave Halter
2014-08-06 12:45:38 +02:00
parent 23c39eff9a
commit e7e7bd29e8
2 changed files with 23 additions and 13 deletions
+6 -4
View File
@@ -7,11 +7,13 @@ possible for the auto completion.
def next(iterator, default=None):
if hasattr("next"):
return iterator.next()
if random.choice([0, 1]):
if hasattr("next"):
return iterator.next()
else:
return iterator.__next__()
else:
return iterator.__next__()
return default
return default
def iter(collection, sentinel=None):