compatibility with Python2.7

This commit is contained in:
Paulo Ricardo [PR]
2016-01-07 17:24:02 -02:00
parent c05ff45217
commit 1f1d3634b7
+2 -1
View File
@@ -245,7 +245,8 @@ def _write_files(s3, app, static_url_loc, static_folder, files, bucket,
logger.warn("Unable to detect mimetype for %s" %
file_path)
with open(file_path, 'rb') as fp:
file_mode = 'rb' if six.PY3 else 'r'
with open(file_path, file_mode) as fp:
metadata, params = split_metadata_params(merge_two_dicts(app.config['FLASKS3_HEADERS'], h))
if per_file_should_gzip:
compressed = StringIO()