Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def _iter_driver_output(self):
while self.driver_stack:
curdriver = self.driver
# Iterate over the current driver until it changes.
for output in curdriver.get_input():
yield output
# If the driver has changed, stop iterating over the old one.
if self.driver is not curdriver:
break
else:
# Driver finished.
if len(self.driver_stack) == 1:
# If it's the final one, finish iterating.
break
else:
# If it's not the final one, pop it off the stack.
self.driver_stack.pop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.