From 0c8b8e93743130fc2966ce96ea2edf3c3b456c11 Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Fri, 14 Jan 2022 19:19:12 +0100 Subject: [PATCH] Remove old python 2 compatibility code --- ihatemoney/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ihatemoney/utils.py b/ihatemoney/utils.py index 96b80816..95ceaf25 100644 --- a/ihatemoney/utils.py +++ b/ihatemoney/utils.py @@ -243,10 +243,7 @@ class IhmJSONEncoder(JSONEncoder): from flask_babel import speaklater if isinstance(o, speaklater.LazyString): - try: - return unicode(o) # For python 2. - except NameError: - return str(o) # For python 3. + return str(o) except ImportError: pass return JSONEncoder.default(self, o)