new method ConsoleApplication.acquire_input() to read stdin friendly
This commit is contained in:
parent
9e3b1a049e
commit
e731f42cb9
4 changed files with 12 additions and 9 deletions
|
|
@ -77,7 +77,7 @@ class Pastoob(ReplApplication):
|
|||
The filename can be '-' for reading standard input (pipe).
|
||||
"""
|
||||
if not filename or filename == '-':
|
||||
contents = sys.stdin.read().decode(sys.stdin.encoding or locale.getpreferredencoding())
|
||||
contents = self.acquire_input()
|
||||
else:
|
||||
try:
|
||||
with codecs.open(filename, encoding=locale.getpreferredencoding()) as fp:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue