File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -16,28 +16,30 @@ def main():
1616 default = None ,
1717 help = "The per-line indent to use when printing a human readable json string" ,
1818 )
19- parser .add_argument (
20- "--encoding" ,
21- "-e" ,
22- type = str ,
23- default = "UTF-8" ,
24- help = "The character encoding use.." ,
25- )
2619 parser .add_argument (
2720 "path" ,
2821 metavar = "path" ,
2922 type = str ,
3023 nargs = 1 ,
3124 help = "Path to the replay to serialize." ,
3225 )
26+ if sys .version_info .major < 3 :
27+ parser .add_argument (
28+ "--encoding" ,
29+ "-e" ,
30+ type = str ,
31+ default = "UTF-8" ,
32+ help = "The character encoding use.." ,
33+ )
34+
3335 args = parser .parse_args ()
3436
3537 factory = sc2reader .factories .SC2Factory ()
3638
3739 if sys .version_info .major < 3 :
3840 factory .register_plugin (
3941 "Replay" , toJSON (encoding = args .encoding , indent = args .indent )
40- ) # legacy Python
42+ )
4143 else :
4244 factory .register_plugin ("Replay" , toJSON (indent = args .indent ))
4345 replay_json = factory .load_replay (args .path [0 ])
You can’t perform that action at this time.
0 commit comments