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.
This commit is contained in:
Ghostkeeper 2018-06-15 11:25:16 +02:00
parent eda0d34fd9
commit 105f6d4271
No known key found for this signature in database
GPG Key ID: 5252B696FB5E7C7A

View File

@ -1,5 +1,8 @@
# Copyright (c) 2018 Ultimaker B.V. # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional, TYPE_CHECKING
from UM.Application import Application from UM.Application import Application
from UM.Math.Vector import Vector from UM.Math.Vector import Vector
from UM.Resources import Resources from UM.Resources import Resources
@ -10,6 +13,8 @@ from UM.View.RenderBatch import RenderBatch
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator 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. ## 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 # 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._renderer = Application.getInstance().getRenderer()
self._shader = None self._shader = None #type: Optional[ShaderProgram]
self._scene = Application.getInstance().getController().getScene() self._scene = Application.getInstance().getController().getScene()
def render(self) -> None: def render(self) -> None: