Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update sc2reader/scripts/sc2json.py
Fixed type - Committed suggestion from PR review #118

Co-authored-by: Christian Clauss <[email protected]>
  • Loading branch information
rohits47 and cclauss authored Jul 8, 2020
commit 54b0cc163b42f2396f8cdd2d5d7c45692d273005
7 changes: 6 additions & 1 deletion sc2reader/scripts/sc2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ def main():
args = parser.parse_args()

factory = sc2reader.factories.SC2Factory()
factory.register_plugin("Replay", toJSON(indent=args.indent))
try:
factory.register_plugin(
"Replay", toJSON(encoding=args.encoding, indent=args.indent)
) # legacy Python
except TypeError:
factory.register_plugin("Replay", toJSON(indent=args.indent))
replay_json = factory.load_replay(args.path[0])
print(replay_json)

Expand Down