aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/codeeditor/codeeditor.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/codeeditor/codeeditor.py')
-rw-r--r--examples/widgets/codeeditor/codeeditor.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/widgets/codeeditor/codeeditor.py b/examples/widgets/codeeditor/codeeditor.py
index f5f119000..bfe92c4a8 100644
--- a/examples/widgets/codeeditor/codeeditor.py
+++ b/examples/widgets/codeeditor/codeeditor.py
@@ -106,6 +106,9 @@ class CodeEditor(QPlainTextEdit):
bottom = top + self.blockBoundingRect(block).height()
block_number += 1
+ # QPainter needs an explicit end() in PyPy. This will become a context manager in 6.3.
+ painter.end()
+
@Slot()
def update_line_number_area_width(self, newBlockCount):
self.setViewportMargins(self.line_number_area_width(), 0, 0, 0)