Skip to content

Commit 78d6b58

Browse files
authored
v2.12.2
2 parents 17f6c44 + 35f71ea commit 78d6b58

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

pyTooling/Common/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
__email__ = "Paebbels@gmail.com"
3838
__copyright__ = "2017-2022, Patrick Lehmann"
3939
__license__ = "Apache License, Version 2.0"
40-
__version__ = "2.12.1"
40+
__version__ = "2.12.2"
4141
__keywords__ = ["decorators", "meta classes", "exceptions", "platform", "versioning", "licensing", "overloading",
4242
"singleton", "tree", "graph", "timer", "data structure", "setuptools", "wheel", "installation",
4343
"packaging", "path", "generic path", "generic library", "url"]

pyTooling/MetaClasses/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
from types import MethodType
4141
from typing import Any, Tuple, List, Dict, Callable, Type, TypeVar
4242

43-
4443
try:
4544
from ..Exceptions import AbstractClassError
4645
from ..Decorators import export, OriginalFunction
@@ -269,18 +268,19 @@ def _checkForAbstractMethods(metacls, baseClasses: Tuple[type], members: Dict[st
269268
:param members: The dictionary of members for the constructed class.
270269
:returns: A tuple of abstract method's names.
271270
"""
272-
result = set()
273-
for base in baseClasses:
274-
if hasattr(base, "__abstractMethods__"):
275-
result = result.union(base.__abstractMethods__)
271+
abstractMethods = set()
272+
if baseClasses:
273+
for baseClass in baseClasses:
274+
if hasattr(baseClass, "__abstractMethods__"):
275+
abstractMethods = abstractMethods.union(baseClass.__abstractMethods__)
276276

277277
for memberName, member in members.items():
278278
if hasattr(member, "__abstract__") or hasattr(member, "__mustOverride__"):
279-
result.add(memberName)
280-
elif memberName in result:
281-
result.remove(memberName)
279+
abstractMethods.add(memberName)
280+
elif memberName in abstractMethods:
281+
abstractMethods.remove(memberName)
282282

283-
return tuple(result)
283+
return tuple(abstractMethods)
284284

285285
@staticmethod
286286
def _wrapNewMethodIfSingleton(newClass, singleton: bool) -> bool:
@@ -360,7 +360,7 @@ def _wrapNewMethodIfAbstract(newClass) -> bool:
360360
if newClass.__abstractMethods__:
361361
oldnew = newClass.__new__
362362
if hasattr(oldnew, "__raises_abstract_class_error__"):
363-
return True
363+
oldnew = oldnew.__orig_func__
364364

365365
@OriginalFunction(oldnew)
366366
@wraps(oldnew)

0 commit comments

Comments
 (0)