Add warning in setup.py about Python 2.6.

This commit is contained in:
Valentin Lorentz 2015-09-20 15:50:43 +02:00
parent fed4258040
commit 3047ea7acb
2 changed files with 10 additions and 1 deletions

View File

@ -228,5 +228,11 @@ setup(
)
if sys.version_info < (2, 7, 0):
sys.stderr.write('+-----------------------------------------------+\n')
sys.stderr.write('| Running Limnoria on Python 2.6 is deprecated. |\n')
sys.stderr.write('| Please consider upgrading to Python 3.x (or |\n')
sys.stderr.write('| at least 2.7) |\n')
sys.stderr.write('+-----------------------------------------------+\n')
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -294,7 +294,10 @@ def perlVariableSubstitute(vars, text):
if callable(x):
return x()
else:
return str(x)
try:
return str(x)
except UnicodeEncodeError: # Python 2
return str(x).encode('utf8')
except KeyError:
if braced:
return '${%s}' % braced