Skip to content

Commit

Permalink
Switch from BytesIO to StringIO for Python 3 compatibility (test only)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Denton committed Aug 17, 2017
1 parent 5177605 commit 9253a1a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions action/_v2_config_template.py
Expand Up @@ -301,7 +301,7 @@ def return_config_overrides_ini(self,
except Exception:
config = ConfigTemplateParser(dict_type=MultiKeyDict)

config_object = io.BytesIO(str(resultant))
config_object = io.StringIO(resultant)
config.readfp(config_object)
for section, items in config_overrides.items():
# If the items value is not a dictionary it is assumed that the
Expand Down Expand Up @@ -336,12 +336,12 @@ def return_config_overrides_ini(self,
else:
config_object.close()

resultant_bytesio = io.BytesIO()
resultant_stringio = io.StringIO()
try:
config.write(resultant_bytesio)
return resultant_bytesio.getvalue()
config.write(resultant_stringio)
return resultant_stringio.getvalue()
finally:
resultant_bytesio.close()
resultant_stringio.close()

@staticmethod
def _option_write(config, section, key, value):
Expand Down

0 comments on commit 9253a1a

Please sign in to comment.