From 897955f0a164349d3191c778cfcb37ee9bff9daf Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sat, 25 Dec 2021 14:34:49 +0200 Subject: Remove all Python 2 support * Removed all __future__ imports from code * Removed all six dependencies * Removed all future_builtins imports * Removed all Python 2 related code Closes: deluge-torrent/deluge#325 --- msgfmt.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'msgfmt.py') diff --git a/msgfmt.py b/msgfmt.py index c0e093ab6..4d0b83911 100755 --- a/msgfmt.py +++ b/msgfmt.py @@ -25,8 +25,6 @@ Options: --version Display version information and exit. """ -from __future__ import print_function, unicode_literals - import array import ast import getopt @@ -103,10 +101,7 @@ def generate(): 0, 0, ) # size and offset of hash table - if sys.version_info.major == 2: - output += array.array(b'i', offsets).tostring() - else: - output += array.array('i', offsets).tobytes() + output += array.array('i', offsets).tobytes() output += ids.encode('utf8') output += strs.encode('utf8') return output @@ -181,9 +176,6 @@ def make(filename, outfile): if not line: continue line = ast.literal_eval(line) - # Python 2 ast.literal_eval returns bytes. - if isinstance(line, bytes): - line = line.decode('utf8') if section == section_id: msgid += line elif section == section_str: -- cgit v1.2.3