From a0c58be371f67aa03335f40b98aa7073f1968cab Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Wed, 18 Mar 2020 23:40:59 +0330 Subject: [PATCH] [tools] Remove py2 remains --- src/gen-os2-unicode-ranges.py | 5 ----- src/gen-use-table.py | 7 +------ test/shaping/hb_test_tools.py | 4 ---- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/gen-os2-unicode-ranges.py b/src/gen-os2-unicode-ranges.py index 49239d659..4d433c50b 100755 --- a/src/gen-os2-unicode-ranges.py +++ b/src/gen-os2-unicode-ranges.py @@ -8,11 +8,6 @@ import io import re import sys -try: - reload(sys) - sys.setdefaultencoding('utf-8') -except NameError: - pass # Python 3 print ("""static OS2Range _hb_os2_unicode_ranges[] = {""") diff --git a/src/gen-use-table.py b/src/gen-use-table.py index e6e6113a0..0cbb52906 100755 --- a/src/gen-use-table.py +++ b/src/gen-use-table.py @@ -151,18 +151,13 @@ property_names = [ 'Overstruck', ] -try: - basestring -except NameError: - basestring = str - class PropertyValue(object): def __init__(self, name_): self.name = name_ def __str__(self): return self.name def __eq__(self, other): - return self.name == (other if isinstance(other, basestring) else other.name) + return self.name == (other if isinstance(other, str) else other.name) def __ne__(self, other): return not (self == other) def __hash__(self): diff --git a/test/shaping/hb_test_tools.py b/test/shaping/hb_test_tools.py index 2af0d2f08..b1fb0bbb4 100644 --- a/test/shaping/hb_test_tools.py +++ b/test/shaping/hb_test_tools.py @@ -2,10 +2,6 @@ import sys, os, re, difflib, unicodedata, errno, cgi, itertools from itertools import * -try: - import unicodedata2 as unicodedata -except Exception: - pass diff_symbols = "-+=*&^%$#@!~/" diff_colors = ['red', 'green', 'blue']