mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Fix the CLI in py3
This commit is contained in:
parent
17999c5b1a
commit
0ff24b4dc8
3 changed files with 22 additions and 13 deletions
pokedex
|
@ -21,7 +21,7 @@ def main(*argv):
|
|||
# XXX there must be a better way to get Unicode argv
|
||||
# XXX this doesn't work on Windows durp
|
||||
enc = sys.stdin.encoding or 'utf8'
|
||||
args = [_.decode(enc) for _ in args]
|
||||
args = [_.decode(enc) if isinstance(_, bytes) else _ for _ in args]
|
||||
|
||||
# Find the command as a function in this file
|
||||
func = globals().get("command_%s" % command, None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue