Skip to content

Commit 94c4280

Browse files
authored
Minor Text tweak (#2645)
1 parent 037e85d commit 94c4280

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arcade/text.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,11 @@ def __init__(
306306
f"but got {width!r}."
307307
)
308308

309+
self._initialized = False
309310
try:
310311
self._init_deferred()
311312
except Exception:
312-
self._initialized = False
313+
pass
313314

314315
@property
315316
def label(self) -> pyglet.text.Label:
@@ -333,12 +334,11 @@ def _init_deferred(self):
333334
"""
334335
Deferred initialization when lazy loaded
335336
"""
336-
337+
# NOTE: Give the user a clear error message stating that the window is not created yet
337338
arcade.get_window()
338339

339340
self._arguments["font_name"] = _attempt_font_name_resolution(self._arguments["font_name"]) # type: ignore
340341
self._label = pyglet.text.Label(**self._arguments) # type: ignore
341-
342342
self._initialized = True
343343

344344
def __enter__(self):

0 commit comments

Comments
 (0)