Skip to content

Commit 54b0cc1

Browse files
rohits47cclauss
andauthored
Update sc2reader/scripts/sc2json.py
Fixed type - Committed suggestion from PR review #118 Co-authored-by: Christian Clauss <[email protected]>
1 parent 6a32c33 commit 54b0cc1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sc2reader/scripts/sc2json.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ def main():
3434
args = parser.parse_args()
3535

3636
factory = sc2reader.factories.SC2Factory()
37-
factory.register_plugin("Replay", toJSON(indent=args.indent))
37+
try:
38+
factory.register_plugin(
39+
"Replay", toJSON(encoding=args.encoding, indent=args.indent)
40+
) # legacy Python
41+
except TypeError:
42+
factory.register_plugin("Replay", toJSON(indent=args.indent))
3843
replay_json = factory.load_replay(args.path[0])
3944
print(replay_json)
4045

0 commit comments

Comments
 (0)