diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-09-20 16:47:04 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-09-20 16:47:04 -0400 |
commit | 4eff58c7c6fc0cd598812aafcbab96a465d0175a (patch) | |
tree | 5495777d73faefacc066ada5031ca9d96c5930d6 /cmd2/cmd2.py | |
parent | 1a34f350f7846ba1ed1397f862a2cba4fa7272b0 (diff) | |
download | cmd2-git-4eff58c7c6fc0cd598812aafcbab96a465d0175a.tar.gz |
Gave startup_script a default of '' instead of None
Diffstat (limited to 'cmd2/cmd2.py')
-rwxr-xr-x | cmd2/cmd2.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 87f8684d..6bfcfdc8 100755 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -341,7 +341,7 @@ class Cmd(cmd.Cmd): def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *, persistent_history_file: str = '', persistent_history_length: int = 1000, - startup_script: Optional[str] = None, use_ipython: bool = False, + startup_script: str = '', use_ipython: bool = False, allow_cli_args: bool = True, transcript_files: Optional[List[str]] = None, allow_redirection: bool = True, multiline_commands: Optional[List[str]] = None, terminators: Optional[List[str]] = None, shortcuts: Optional[Dict[str, str]] = None) -> None: @@ -499,7 +499,7 @@ class Cmd(cmd.Cmd): self._startup_commands = [] # If a startup script is provided, then execute it in the startup commands - if startup_script is not None: + if startup_script: startup_script = os.path.abspath(os.path.expanduser(startup_script)) if os.path.exists(startup_script) and os.path.getsize(startup_script) > 0: self._startup_commands.append("run_script '{}'".format(startup_script)) |