Skip to content

Commit 4eff58c

Browse files
committed
Gave startup_script a default of '' instead of None
1 parent 1a34f35 commit 4eff58c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd2/cmd2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class Cmd(cmd.Cmd):
341341

342342
def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *,
343343
persistent_history_file: str = '', persistent_history_length: int = 1000,
344-
startup_script: Optional[str] = None, use_ipython: bool = False,
344+
startup_script: str = '', use_ipython: bool = False,
345345
allow_cli_args: bool = True, transcript_files: Optional[List[str]] = None,
346346
allow_redirection: bool = True, multiline_commands: Optional[List[str]] = None,
347347
terminators: Optional[List[str]] = None, shortcuts: Optional[Dict[str, str]] = None) -> None:
@@ -499,7 +499,7 @@ def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *,
499499
self._startup_commands = []
500500

501501
# If a startup script is provided, then execute it in the startup commands
502-
if startup_script is not None:
502+
if startup_script:
503503
startup_script = os.path.abspath(os.path.expanduser(startup_script))
504504
if os.path.exists(startup_script) and os.path.getsize(startup_script) > 0:
505505
self._startup_commands.append("run_script '{}'".format(startup_script))

0 commit comments

Comments
 (0)