diff options
author | Jonathan Slenders <jonathan@slenders.be> | 2016-12-17 12:28:17 +0100 |
---|---|---|
committer | Jonathan Slenders <jonathan@slenders.be> | 2016-12-17 12:28:17 +0100 |
commit | 59328630597daa813192b81365bc4132a859b2d6 (patch) | |
tree | 2da05e03253ca9f4c7635e8eb7b283385d9e8c7c | |
parent | 1c2410855a9473ef140c958d3752da52fb4eddcb (diff) |
Turn self.get_continuation_tokens into a list as soon as possible.
-rw-r--r-- | prompt_toolkit/layout/margins.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/prompt_toolkit/layout/margins.py b/prompt_toolkit/layout/margins.py index 17150270..2934dfc9 100644 --- a/prompt_toolkit/layout/margins.py +++ b/prompt_toolkit/layout/margins.py @@ -231,7 +231,10 @@ class PromptMargin(Margin): # Next lines. (Show line numbering when numbering is enabled.) if self.get_continuation_tokens: - tokens2 = self.get_continuation_tokens(cli, width) + # Note: we turn this into a list, to make sure that we fail early + # in case `get_continuation_tokens` returns something else, + # like `None`. + tokens2 = list(self.get_continuation_tokens(cli, width)) else: tokens2 = [] |