From 0ede3177ba079a2cc14b41cfd18f37aac56ed95a 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)