From 88fc98df9fb7a1468662ad9863a25d01eebe3b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20=C3=87ehreli?= Date: Mon, 9 Apr 2018 15:53:34 -0700 Subject: [PATCH] Replace "yield from" with regular yield to avoid requiring Python 3 --- plumbum/cli/application.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plumbum/cli/application.py b/plumbum/cli/application.py index b7301cdca..37de76312 100644 --- a/plumbum/cli/application.py +++ b/plumbum/cli/application.py @@ -135,7 +135,7 @@ def main(self, src, dst): def __new__(cls, executable=None): """Allows running the class directly as a shortcut for main. - This is neccessary for some setup scripts that want a single function, + This is necessary for some setup scripts that want a single function, instead of an expression with a dot in it.""" @@ -658,7 +658,8 @@ def current(): if len(line) == 0: # Starting a new paragraph - yield from current() + for item in current(): + yield item yield "", "", "" paragraph = None @@ -679,7 +680,8 @@ def has_invisible_bullet(line): if is_list_item(line): # Done with current paragraph - yield from current() + for item in current(): + yield item if has_invisible_bullet(line): line = line[1:] @@ -701,7 +703,8 @@ def has_invisible_bullet(line): # Add to current paragraph paragraph = paragraph + ' ' + line - yield from current() + for item in current(): + yield item def wrapped_paragraphs(text, width):