Python2 is dumb.

This commit is contained in:
SunDwarf
2015-09-28 16:34:59 +01:00
parent 2bbc292b7f
commit d8ab184531
2 changed files with 9 additions and 1 deletions
+1
View File
@@ -4,6 +4,7 @@ python:
# - "3.2" # 3.2 is broken, for some reason
- "3.3"
- "3.4"
- "3.5"
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install: pip install -r requirements.txt --use-mirrors
# command to run tests, e.g. python setup.py test
+8 -1
View File
@@ -130,7 +130,14 @@ def _static_folder_path(static_url, static_folder, static_asset):
(static_asset, static_folder))
rel_asset = static_asset[len(static_folder):]
# Now bolt the static url path and the relative asset location together
return six.u('%s/%s' % (static_url.rstrip('/'), rel_asset.lstrip('/')))
if six.PY2:
if not isinstance(static_url, unicode) or not isinstance(rel_asset, unicode):
u = six.u
else:
u = str
else:
u = str
return u('%s/%s' % (static_url.rstrip('/'), rel_asset.lstrip('/')))
def _write_files(s3, app, static_url_loc, static_folder, files, bucket,