Skip to content

Commit

Permalink
Ensure loader loads with OrderedDict
Browse files Browse the repository at this point in the history
  • Loading branch information
phlax committed Jan 1, 2018
1 parent 8bd13af commit 1373837
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion makeyfile/loader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import json
from collections import OrderedDict

from .exceptions import MakeyError

Expand All @@ -10,7 +11,9 @@ def load(self, filepath):
try:
with open(filepath, 'r') as makeyfile:
try:
return json.loads(makeyfile.read())
return json.loads(
makeyfile.read(),
object_pairs_hook=OrderedDict)
except ValueError as e:
raise MakeyError('Failed to parse the makeyfile', e)
except IOError as e:
Expand Down

0 comments on commit 1373837

Please sign in to comment.