Skip to content

Commit

Permalink
v2.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Feb 13, 2023
2 parents 17f6c44 + 35f71ea commit 78d6b58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyTooling/Common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
__email__ = "Paebbels@gmail.com"
__copyright__ = "2017-2022, Patrick Lehmann"
__license__ = "Apache License, Version 2.0"
__version__ = "2.12.1"
__version__ = "2.12.2"
__keywords__ = ["decorators", "meta classes", "exceptions", "platform", "versioning", "licensing", "overloading",
"singleton", "tree", "graph", "timer", "data structure", "setuptools", "wheel", "installation",
"packaging", "path", "generic path", "generic library", "url"]
Expand Down
20 changes: 10 additions & 10 deletions pyTooling/MetaClasses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from types import MethodType
from typing import Any, Tuple, List, Dict, Callable, Type, TypeVar


try:
from ..Exceptions import AbstractClassError
from ..Decorators import export, OriginalFunction
Expand Down Expand Up @@ -269,18 +268,19 @@ def _checkForAbstractMethods(metacls, baseClasses: Tuple[type], members: Dict[st
:param members: The dictionary of members for the constructed class.
:returns: A tuple of abstract method's names.
"""
result = set()
for base in baseClasses:
if hasattr(base, "__abstractMethods__"):
result = result.union(base.__abstractMethods__)
abstractMethods = set()
if baseClasses:
for baseClass in baseClasses:
if hasattr(baseClass, "__abstractMethods__"):
abstractMethods = abstractMethods.union(baseClass.__abstractMethods__)

for memberName, member in members.items():
if hasattr(member, "__abstract__") or hasattr(member, "__mustOverride__"):
result.add(memberName)
elif memberName in result:
result.remove(memberName)
abstractMethods.add(memberName)
elif memberName in abstractMethods:
abstractMethods.remove(memberName)

return tuple(result)
return tuple(abstractMethods)

@staticmethod
def _wrapNewMethodIfSingleton(newClass, singleton: bool) -> bool:
Expand Down Expand Up @@ -360,7 +360,7 @@ def _wrapNewMethodIfAbstract(newClass) -> bool:
if newClass.__abstractMethods__:
oldnew = newClass.__new__
if hasattr(oldnew, "__raises_abstract_class_error__"):
return True
oldnew = oldnew.__orig_func__

@OriginalFunction(oldnew)
@wraps(oldnew)
Expand Down

0 comments on commit 78d6b58

Please sign in to comment.