From 105f6d4271e0421d44d7907681f3041443853ba3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 15 Jun 2018 11:25:16 +0200 Subject: [PATCH] Fix type of self._shader MyPy was thinking that this variable has type None, which is nonsense because no variable should always have type None. Contributes to issue CURA-5330. --- cura/PickingPass.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cura/PickingPass.py b/cura/PickingPass.py index 40a0aaf949..7512b4fc3e 100644 --- a/cura/PickingPass.py +++ b/cura/PickingPass.py @@ -1,5 +1,8 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. + +from typing import Optional, TYPE_CHECKING + from UM.Application import Application from UM.Math.Vector import Vector from UM.Resources import Resources @@ -10,6 +13,8 @@ from UM.View.RenderBatch import RenderBatch from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator +if TYPE_CHECKING: + from UM.View.GL.ShaderProgram import ShaderProgram ## A RenderPass subclass that renders a the distance of selectable objects from the active camera to a texture. # The texture is used to map a 2d location (eg the mouse location) to a world space position @@ -21,7 +26,7 @@ class PickingPass(RenderPass): self._renderer = Application.getInstance().getRenderer() - self._shader = None + self._shader = None #type: Optional[ShaderProgram] self._scene = Application.getInstance().getController().getScene() def render(self) -> None: