Skip to content

Commit 9c06314

Browse files
nimrod-gileadicopybara-github
authored andcommitted
Allow renderers to build with pytype.
PiperOrigin-RevId: 520145182 Change-Id: I7875a1e39d7e65d32132d47a0ff62b4174ea6e16
1 parent 6817b67 commit 9c06314

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

dm_control/_render/pyopengl/egl_renderer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class EGLContext(base.ContextBase):
9696
def __init__(self, max_width, max_height):
9797
# EGLContext currently only works with `PassthroughRenderExecutor`.
9898
# TODO(b/110927854) Make this work with the offloading executor.
99+
self._context = None
99100
super().__init__(max_width, max_height, executor.PassthroughRenderExecutor)
100101

101102
def _platform_init(self, unused_max_width, unused_max_height):

dm_control/_render/pyopengl/osmesa_renderer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
class OSMesaContext(base.ContextBase):
4545
"""An OpenGL context backed by OSMesa."""
4646

47+
def __init__(self, *args, **kwargs):
48+
self._context = None
49+
super().__init__(*args, **kwargs)
50+
4751
def _platform_init(self, max_width, max_height):
4852
"""Initializes this OSMesa context."""
4953
self._context = osmesa.OSMesaCreateContextExt(

0 commit comments

Comments
 (0)