summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-12-01 12:42:43 +0000
committerGerrit Code Review <review@openstack.org>2015-12-01 12:42:43 +0000
commite023805399831cc87045694eb5f6e314586575a3 (patch)
tree87f31790d347e3d7d3045ef92d7554b8543fbf9b
parentaef8b0f2e36c245b28dff18c1139183406ab0ba0 (diff)
parent2d76ae46feb75c67d2a1f029712999fd97929dfa (diff)
downloadoslo-i18n-e023805399831cc87045694eb5f6e314586575a3.tar.gz
Merge "Remove Python 2.6 workround for logging"3.1.0
-rw-r--r--oslo_i18n/_message.py10
-rw-r--r--oslo_i18n/tests/test_message.py6
2 files changed, 0 insertions, 16 deletions
diff --git a/oslo_i18n/_message.py b/oslo_i18n/_message.py
index 9dff366..d03337d 100644
--- a/oslo_i18n/_message.py
+++ b/oslo_i18n/_message.py
@@ -228,13 +228,3 @@ class Message(six.text_type):
def __radd__(self, other):
return self.__add__(other)
-
- if six.PY2:
- def __str__(self):
- # NOTE(luisg): Logging in python 2.6 tries to str() log records,
- # and it expects specifically a UnicodeError in order to proceed.
- from oslo_i18n._i18n import _
- msg = _('Message objects do not support str() because they may '
- 'contain non-ascii characters. '
- 'Please use unicode() or translate() instead.')
- raise UnicodeError(msg)
diff --git a/oslo_i18n/tests/test_message.py b/oslo_i18n/tests/test_message.py
index 47dd365..ba7851f 100644
--- a/oslo_i18n/tests/test_message.py
+++ b/oslo_i18n/tests/test_message.py
@@ -303,12 +303,6 @@ class MessageTestCase(test_base.BaseTestCase):
test_me = lambda: utils.SomeObject('test') + _message.Message(msgid)
self.assertRaises(TypeError, test_me)
- @testtools.skipIf(six.PY3, 'test specific to Python 2')
- def test_str_disabled(self):
- msgid = "A message"
- test_me = lambda: str(_message.Message(msgid))
- self.assertRaises(UnicodeError, test_me)
-
@mock.patch('gettext.translation')
def test_translate(self, mock_translation):
en_message = 'A message in the default locale'