From b5fb43fdd8cecc02714375511d81a9f7e327976a Mon Sep 17 00:00:00 2001 From: ines Date: Mon, 22 May 2017 12:29:15 +0200 Subject: [PATCH] Allow sys.exit status as exits keyword arg in util.prints() --- spacy/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index 6d406a36a..f27df54a8 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -380,13 +380,13 @@ def prints(*texts, **kwargs): *texts (unicode): Texts to print. Each argument is rendered as paragraph. **kwargs: 'title' becomes coloured headline. 'exits'=True performs sys exit. """ - exits = kwargs.get('exits', False) + exits = kwargs.get('exits', None) title = kwargs.get('title', None) title = '\033[93m{}\033[0m\n'.format(_wrap(title)) if title else '' message = '\n\n'.join([_wrap(text) for text in texts]) print('\n{}{}\n'.format(title, message)) - if exits: - sys.exit(0) + if exits is not None: + sys.exit(exits) def _wrap(text, wrap_max=80, indent=4):