aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/tutorials/cannon/t11.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/tutorials/cannon/t11.py')
-rw-r--r--examples/widgets/tutorials/cannon/t11.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/widgets/tutorials/cannon/t11.py b/examples/widgets/tutorials/cannon/t11.py
index f297a14b4..ea8e53a8e 100644
--- a/examples/widgets/tutorials/cannon/t11.py
+++ b/examples/widgets/tutorials/cannon/t11.py
@@ -164,6 +164,8 @@ class CannonField(QWidget):
self.paint_cannon(painter)
if self._auto_shoot_timer.isActive():
self.paint_shot(painter)
+ # QPainter needs an explicit end() in PyPy. This will become a context manager in 6.3.
+ painter.end()
def paint_shot(self, painter):
painter.setPen(Qt.NoPen)