File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -306,10 +306,11 @@ def __init__(
306
306
f"but got { width !r} ."
307
307
)
308
308
309
+ self ._initialized = False
309
310
try :
310
311
self ._init_deferred ()
311
312
except Exception :
312
- self . _initialized = False
313
+ pass
313
314
314
315
@property
315
316
def label (self ) -> pyglet .text .Label :
@@ -333,12 +334,11 @@ def _init_deferred(self):
333
334
"""
334
335
Deferred initialization when lazy loaded
335
336
"""
336
-
337
+ # NOTE: Give the user a clear error message stating that the window is not created yet
337
338
arcade .get_window ()
338
339
339
340
self ._arguments ["font_name" ] = _attempt_font_name_resolution (self ._arguments ["font_name" ]) # type: ignore
340
341
self ._label = pyglet .text .Label (** self ._arguments ) # type: ignore
341
-
342
342
self ._initialized = True
343
343
344
344
def __enter__ (self ):
You can’t perform that action at this time.
0 commit comments