Skip to content

Commit f088867

Browse files
authored
Merge pull request #118 from rohits47/fix-toDict
Fixes toJson in sc2reader/scripts/sc2json.py
2 parents f05344d + 54b0cc1 commit f088867

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sc2reader/scripts/sc2json.py

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

3636
factory = sc2reader.factories.SC2Factory()
37-
factory.register_plugin(
38-
"Replay", toJSON(encoding=args.encoding, indent=args.indent)
39-
)
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))
4043
replay_json = factory.load_replay(args.path[0])
4144
print(replay_json)
4245

0 commit comments

Comments
 (0)