Skip to content

Commit

Permalink
Eliminate warning in test suite (#621)
Browse files Browse the repository at this point in the history
* Typo

* Update wgpu/_classes.py

Accidentally duplicated line

Co-authored-by: Almar Klein <almar@almarklein.org>

---------

Co-authored-by: Almar Klein <almar@almarklein.org>
  • Loading branch information
fyellin and almarklein authored Oct 16, 2024
1 parent 6bb8bf6 commit e30c495
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wgpu/_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,6 @@ def __init__(self, canvas):
self._ot.increase(self.__class__.__name__)
self._canvas_ref = weakref.ref(canvas)

# The configuration from the canvas, obtained with canvas.get_present_info()
self._present_info = canvas.get_present_info()
if self._present_info.get("method", None) not in ("screen", "image"):
raise RuntimeError(
"canvas.get_present_info() must produce a dict with a field 'method' that is either 'screen' or 'image'."
)

# Surface capabilities. Stored the first time it is obtained
self._capabilities = None

Expand All @@ -234,6 +227,13 @@ def __init__(self, canvas):
# The last used texture
self._texture = None

# The configuration from the canvas, obtained with canvas.get_present_info()
self._present_info = canvas.get_present_info()
if self._present_info.get("method", None) not in ("screen", "image"):
raise RuntimeError(
"canvas.get_present_info() must produce a dict with a field 'method' that is either 'screen' or 'image'."
)

def _get_canvas(self):
"""Getter method for internal use."""
return self._canvas_ref()
Expand Down

0 comments on commit e30c495

Please sign in to comment.