From e193d829d13f3e39977b0f842aebee921bdaed30 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Tue, 17 Dec 2013 13:39:52 +0100 Subject: [PATCH] Python 3: fix a call to ugettext() In Python 3, ugettext() does not exist and gettext() should be used instead. Closes-Bug: 128485 Change-Id: Id9f51f0d630ef0c92fc315253c45d3abba356cd1 --- neutronclient/common/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neutronclient/common/__init__.py b/neutronclient/common/__init__.py index 4d201f29f..fb715cf41 100644 --- a/neutronclient/common/__init__.py +++ b/neutronclient/common/__init__.py @@ -16,7 +16,11 @@ import gettext t = gettext.translation('neutronclient', fallback=True) +try: + ugettext = t.ugettext # Python 2 +except AttributeError: + ugettext = t.gettext # Python 3 def _(msg): - return t.ugettext(msg) + return ugettext(msg)