Skip to content

Commit d5f6c5d

Browse files
committed
Also mask cmd line option to not show for python 3
1 parent 99e1071 commit d5f6c5d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

sc2reader/scripts/sc2json.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff 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])

0 commit comments

Comments
 (0)