fix windows build
This commit is contained in:
@ -35,20 +35,24 @@ class ObjectUtils:
|
||||
"""
|
||||
检查函数是否已实现
|
||||
"""
|
||||
source = inspect.getsource(func)
|
||||
in_comment = False
|
||||
for line in source.split('\n'):
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
if line.startswith('"""') or line.startswith("'''"):
|
||||
in_comment = not in_comment
|
||||
continue
|
||||
if not in_comment and not (line.startswith('#')
|
||||
or line == "pass"
|
||||
or line.startswith('@')
|
||||
or line.startswith('def ')):
|
||||
return True
|
||||
try:
|
||||
source = inspect.getsource(func)
|
||||
in_comment = False
|
||||
for line in source.split('\n'):
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
if line.startswith('"""') or line.startswith("'''"):
|
||||
in_comment = not in_comment
|
||||
continue
|
||||
if not in_comment and not (line.startswith('#')
|
||||
or line == "pass"
|
||||
or line.startswith('@')
|
||||
or line.startswith('def ')):
|
||||
return True
|
||||
except Exception as err:
|
||||
print(str(err))
|
||||
return func.__code__.co_code not in [b'd\x01S\x00', b'\x97\x00d\x00S\x00']
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
|
Reference in New Issue
Block a user