sometimes sys.stdin.encoding is None
This commit is contained in:
parent
404db79007
commit
1103e7f79b
1 changed files with 1 additions and 1 deletions
|
|
@ -134,7 +134,7 @@ class BaseApplication(object):
|
|||
@classmethod
|
||||
def run(klass, args=None):
|
||||
if args is None:
|
||||
args = [arg.decode(sys.stdin.encoding) for arg in sys.argv]
|
||||
args = [(sys.stdin.encoding and arg.decode(sys.stdin.encoding) or arg) for arg in sys.argv]
|
||||
app = klass()
|
||||
app.options, args = app._parser.parse_args(args)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue