diff options
Diffstat (limited to 'examples/widgets/richtext/syntaxhighlighter.py')
-rw-r--r-- | examples/widgets/richtext/syntaxhighlighter.py | 9 |
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): |