Skip to content

Commit

Permalink
Use get_origin function.
Browse files Browse the repository at this point in the history
  • Loading branch information
daizutabi committed Jun 16, 2020
1 parent bc583e9 commit b2773e2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mkapi/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from typing import Any, Callable, Iterator, List, Optional

from mkapi.core.base import Base, Type
from mkapi.core.object import from_object, get_object, get_sourcefiles
from mkapi.core.object import (from_object, get_object, get_origin,
get_sourcefiles)
from mkapi.core.structure import Object, Tree


Expand Down Expand Up @@ -151,10 +152,7 @@ def is_member(obj: Any, name: str = "", sourcefiles: List[str] = None) -> int:
"""
if name == "":
name = obj.__name__
if isinstance(obj, property):
obj = obj.fget
if hasattr(obj, "__pytest_wrapped__"):
obj = obj.__pytest_wrapped__.obj
obj = get_origin(obj)
if name in ["__func__", "__self__"]:
return -1
if name.startswith("_"):
Expand Down

0 comments on commit b2773e2

Please sign in to comment.