Skip to content

Commit fa7df08

Browse files
committed
Remove use of builtins from the future python 2 package
1 parent 3b9e8ef commit fa7df08

File tree

5 files changed

+4
-9
lines changed

5 files changed

+4
-9
lines changed

preditor/enum.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import abc
44
import re
5-
from builtins import str as text
65
from numbers import Number
76

87
# =============================================================================
@@ -203,7 +202,7 @@ def __eq__(self, value):
203202
return self.number == value.number
204203
if isinstance(value, int):
205204
return self.number == value
206-
if isinstance(value, str) or isinstance(value, text):
205+
if isinstance(value, str):
207206
if self._compareStr(value):
208207
return True
209208
return False

preditor/gui/console.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import sys
66
import time
77
import traceback
8-
from builtins import str as text
98
from functools import partial
109
from typing import Optional
1110

@@ -344,7 +343,7 @@ def insertFromMimeData(self, mimeData):
344343
r'\"\<\>\?\`\-\=\[\]\\\;\'\,\.\/ \t\n]'
345344
)
346345
)
347-
newText = text(txt)
346+
newText = str(txt)
348347
for each in exp.findall(newText):
349348
newText = newText.replace(each, '?')
350349

preditor/gui/loggerwindow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import shutil
1010
import sys
1111
import warnings
12-
from builtins import bytes
1312
from datetime import datetime, timedelta
1413
from enum import IntEnum
1514
from functools import partial

preditor/osystem.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import os
1212
import subprocess
1313
import sys
14-
from builtins import str as text
1514

1615
import preditor
1716

@@ -241,7 +240,7 @@ def normalize(i):
241240
]
242241
path = os.path.pathsep.join(paths)
243242
# subprocess does not accept unicode in python 2
244-
if sys.version_info[0] == 2 and isinstance(path, text):
243+
if sys.version_info[0] == 2 and isinstance(path, str):
245244
path = path.encode('utf8')
246245
env['PATH'] = path
247246

preditor/scintilla/lexers/maxscriptlexer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import absolute_import
22

33
import re
4-
from builtins import str as text
54

65
from .. import Qsci, QsciScintilla
76

@@ -212,7 +211,7 @@ def styleText(self, start, end):
212211

213212
# cache objects used by processChunk that do not need updated every time it is
214213
# called
215-
self.hlkwords = set(text(self.keywords(self.SmartHighlight)).lower().split())
214+
self.hlkwords = set(str(self.keywords(self.SmartHighlight)).lower().split())
216215
self.chunkRegex = re.compile('([^A-Za-z0-9]*)([A-Za-z0-9]*)')
217216
kwrds = set(MS_KEYWORDS.split())
218217

0 commit comments

Comments
 (0)