From 1fceed1fc3565080eef556c9b71498780aa94bf2 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Tue, 27 Oct 2020 20:12:12 +0100 Subject: 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 Reviewed-by: Friedemann Kleint --- examples/widgets/richtext/syntaxhighlighter.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'examples/widgets/richtext') 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): -- cgit v1.2.3