diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-08-08 23:29:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-08 23:29:58 -0400 |
commit | 20d2abbc101c1f75d9c3d3fb4d1955ed5100a923 (patch) | |
tree | 1d959a196ea424e370d78deec5b64825e5e09695 /cmd2/cmd2.py | |
parent | e1cde42b9f60e85233909a2648df28124c7f12e7 (diff) | |
parent | 1bbf27fbd10848542940d5657e653f60969ed1c5 (diff) | |
download | cmd2-git-20d2abbc101c1f75d9c3d3fb4d1955ed5100a923.tar.gz |
Merge pull request #758 from python-cmd2/empty_script_ok
No longer treating empty text scripts as an error condition
Diffstat (limited to 'cmd2/cmd2.py')
-rwxr-xr-x | cmd2/cmd2.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index a0df0b00..9d29418b 100755 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3790,9 +3790,8 @@ class Cmd(cmd.Cmd): self.perror("'{}' is not a file".format(expanded_path)) return - # Make sure the file is not empty + # An empty file is not an error, so just return if os.path.getsize(expanded_path) == 0: - self.perror("'{}' is empty".format(expanded_path)) return # Make sure the file is ASCII or UTF-8 encoded text |