Skip to content

Commit 6404bc4

Browse files
authored
Aktualisieren von commons.py
1 parent f810195 commit 6404bc4

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

scratchattach/editor/commons.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import random
88
import string
99
from typing import Optional, Final, Any, TYPE_CHECKING, Union, Self
10-
from enum import EnumType, Enum
10+
from enum import EnumMeta, Enum
1111

1212
if TYPE_CHECKING:
1313
from . import sprite, build_defaulting
@@ -257,7 +257,12 @@ def get_name_nofldr(name: str) -> str:
257257
else:
258258
return name[len(fldr) + 2:]
259259

260-
class SingletonMeta(EnumType):
260+
class SingletonMeta(EnumMeta):
261+
def __new__(cls, *args, **kwargs):
262+
result = super.__new__(cls, *args, **kwargs)
263+
result.__class__ = EnumMeta
264+
return result
265+
261266
def __call__(self, value=0, *args, **kwds):
262267
if value != 0:
263268
raise ValueError("Value must be 0.")

0 commit comments

Comments
 (0)