pastoob: Abort if paste is empty
This commit is contained in:
parent
853afb52b2
commit
770c0877a0
1 changed files with 4 additions and 0 deletions
|
|
@ -78,6 +78,10 @@ class Pastoob(ReplApplication):
|
|||
"""
|
||||
if not filename or filename == '-':
|
||||
contents = self.acquire_input()
|
||||
if not len(contents):
|
||||
print >>sys.stderr, 'Empty paste, aborting.'
|
||||
return 1
|
||||
|
||||
else:
|
||||
try:
|
||||
with codecs.open(filename, encoding=locale.getpreferredencoding()) as fp:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue