mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Several callable objects do not have __qualname__
This commit is contained in:
parent
ca3f8386d7
commit
8ed788660b
|
@ -930,6 +930,8 @@ def is_same_func(func1: Callable, func2: Callable) -> bool:
|
|||
"""
|
||||
if not callable(func1) or not callable(func2):
|
||||
return False
|
||||
if not hasattr(func1,"__qualname__") or not hasattr(func2,"__qualname__"):
|
||||
return False
|
||||
same_name = func1.__qualname__ == func2.__qualname__
|
||||
same_file = inspect.getfile(func1) == inspect.getfile(func2)
|
||||
same_code = inspect.getsourcelines(func1) == inspect.getsourcelines(func2)
|
||||
|
|
Loading…
Reference in New Issue
Block a user