Commit 4a2db77f authored by Dave Kuhlman's avatar Dave Kuhlman

Merged in nagylzs/generateds (pull request #33)

Fix input file encodings for Python 3
parents 6ed6e78b 09805b57
......@@ -210,12 +210,13 @@ def resolve_ref(node, params, options):
raise SchemaIOError(msg)
else:
if os.path.exists(locn):
infile = open(locn)
unencoded_content = infile.read()
if sys.version_info.major == 2:
infile = open(locn)
unencoded_content = infile.read()
content = unencoded_content
else:
content = unencoded_content.encode()
infile = open(locn, 'rb')
content = infile.read()
infile.close()
params.parent_url = locn
params.base_url = os.path.split(locn)[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment