aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/richtext
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2020-10-27 20:12:12 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2020-10-28 13:56:40 +0000
commit1fceed1fc3565080eef556c9b71498780aa94bf2 (patch)
tree848628ec5561e8c90d19cf3996f1047d39ab7928 /examples/widgets/richtext
parent1bc8c8ce262d80bbea0141f48055342adca9e3f9 (diff)
examples: Remove Python 2.7 and <3.6 related code
* removing from __future__ import ... * updating CMakeLists.txt files * removing special if-else for Python 2 and 3 Change-Id: I8a34b06b6b384ebc5323f20f7c15c357a5be6d62 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/widgets/richtext')
-rw-r--r--examples/widgets/richtext/syntaxhighlighter.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/examples/widgets/richtext/syntaxhighlighter.py b/examples/widgets/richtext/syntaxhighlighter.py
index 9be299401..576e8baef 100644
--- a/examples/widgets/richtext/syntaxhighlighter.py
+++ b/examples/widgets/richtext/syntaxhighlighter.py
@@ -75,14 +75,7 @@ class MainWindow(QtWidgets.QMainWindow):
inFile = QtCore.QFile(path[0])
if inFile.open(QtCore.QFile.ReadOnly | QtCore.QFile.Text):
text = inFile.readAll()
-
- try:
- # Python v3.
- text = str(text, encoding='ascii')
- except TypeError:
- # Python v2.
- text = str(text)
-
+ text = str(text, encoding='ascii')
self.editor.setPlainText(text)
def setupEditor(self):