Fix initial_text None.
This commit is contained in:
parent
c298949d98
commit
56cd1065f9
1 changed files with 4 additions and 2 deletions
|
@ -72,11 +72,13 @@ def tempeditor(initial_text=None):
|
||||||
raise BadStatus(subproctools.format_command(command), status)
|
raise BadStatus(subproctools.format_command(command), status)
|
||||||
|
|
||||||
def tempeditor_argparse(args):
|
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)
|
initial_text = pipeable.input(args.initial_text, split_lines=False)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
text = tempeditor(initial_text=args.initial_text)
|
text = tempeditor(initial_text=initial_text)
|
||||||
pipeable.stdout(text)
|
pipeable.stdout(text)
|
||||||
return 0
|
return 0
|
||||||
except NoEditor as exc:
|
except NoEditor as exc:
|
||||||
|
|
Loading…
Reference in a new issue