Merge "python3: Fix unicode and gettext"

This commit is contained in:
Jenkins 2013-08-03 14:30:45 +00:00 committed by Gerrit Code Review
commit cd6d69eae7

View File

@ -40,7 +40,13 @@ from hacking import config
logging.disable('LOG')
# Import tests need to inject _ properly into the builtins
gettext.install('hacking', unicode=1)
kwargs = {}
if sys.version_info[0] < 3:
# In Python2, eusnure that the _() that gets installed into built-ins
# always returns unicodes. This matches the default behavior under Python
# 3, although the keyword arguement is not present in the Python 3 API.
kwargs['unicode'] = True
gettext.install('hacking', **kwargs)
def flake8ext(f):