|
40 | 40 | from types import MethodType
|
41 | 41 | from typing import Any, Tuple, List, Dict, Callable, Type, TypeVar
|
42 | 42 |
|
43 |
| - |
44 | 43 | try:
|
45 | 44 | from ..Exceptions import AbstractClassError
|
46 | 45 | from ..Decorators import export, OriginalFunction
|
@@ -269,18 +268,19 @@ def _checkForAbstractMethods(metacls, baseClasses: Tuple[type], members: Dict[st
|
269 | 268 | :param members: The dictionary of members for the constructed class.
|
270 | 269 | :returns: A tuple of abstract method's names.
|
271 | 270 | """
|
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__) |
276 | 276 |
|
277 | 277 | for memberName, member in members.items():
|
278 | 278 | 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) |
282 | 282 |
|
283 |
| - return tuple(result) |
| 283 | + return tuple(abstractMethods) |
284 | 284 |
|
285 | 285 | @staticmethod
|
286 | 286 | def _wrapNewMethodIfSingleton(newClass, singleton: bool) -> bool:
|
@@ -360,7 +360,7 @@ def _wrapNewMethodIfAbstract(newClass) -> bool:
|
360 | 360 | if newClass.__abstractMethods__:
|
361 | 361 | oldnew = newClass.__new__
|
362 | 362 | if hasattr(oldnew, "__raises_abstract_class_error__"):
|
363 |
| - return True |
| 363 | + oldnew = oldnew.__orig_func__ |
364 | 364 |
|
365 | 365 | @OriginalFunction(oldnew)
|
366 | 366 | @wraps(oldnew)
|
|
0 commit comments