From 56cd1065f9fa8446367b1be3c451a44d62c9aa38 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 22 Sep 2021 23:20:15 -0700 Subject: [PATCH] Fix initial_text None. --- tempeditor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tempeditor.py b/tempeditor.py index 0de3022..2b6d8e8 100644 --- a/tempeditor.py +++ b/tempeditor.py @@ -72,11 +72,13 @@ def tempeditor(initial_text=None): raise BadStatus(subproctools.format_command(command), status) def tempeditor_argparse(args): - if args.initial_text is not None: + if args.initial_text is None: + initial_text = None + else: initial_text = pipeable.input(args.initial_text, split_lines=False) try: - text = tempeditor(initial_text=args.initial_text) + text = tempeditor(initial_text=initial_text) pipeable.stdout(text) return 0 except NoEditor as exc: