Skip to content

Commit

Permalink
支持 sys.stdin.encoding 为 None 的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Aug 5, 2018
1 parent e56fa29 commit 7dc59b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pypinyin/runner.py
Expand Up @@ -98,7 +98,7 @@ def main():
parser = get_parser()
options = parser.parse_args(args)
if PY2:
hans = options.hans.decode(sys.stdin.encoding)
hans = options.hans.decode(sys.stdin.encoding or 'utf-8')
else:
hans = options.hans
func = getattr(pypinyin, options.func)
Expand Down

0 comments on commit 7dc59b9

Please sign in to comment.