Skip to content

Commit

Permalink
Fix: No return value of mathutils's freeze functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nutti committed Sep 24, 2023
1 parent c6338da commit 343c822
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/fake_bpy_module/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,17 @@ def _parse_rtype(file: IO[Any], level: 'RstLevel') -> str:

info["parameters"].append(param_info)

if return_ is not None and return_type is not None:
return_info = ReturnInfo()
if return_ is not None:
return_info.set_description(self._cleanup_string(return_))
if return_ is not None:
if return_ == "An instance of this object.":
return_type = "Same type with self class"
if return_type is not None:
return_info.set_data_type(IntermidiateDataType(
self._cleanup_string(return_type)))
info["return"] = return_info
return_info = ReturnInfo()
if return_ is not None:
return_info.set_description(self._cleanup_string(return_))
if return_type is not None:
return_info.set_data_type(IntermidiateDataType(
self._cleanup_string(return_type)))
info["return"] = return_info

return info

Expand Down
7 changes: 7 additions & 0 deletions src/fake_bpy_module/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,13 @@ def _get_refined_data_type_fast(
if re.match(r"^\s*$", dtype_str):
return ModifierDataType("typing.Any")

if dtype_str == "Same type with self class":
s = self._parse_custom_data_type(
module_name, uniq_full_names, uniq_module_names, module_name)
print(f"@@@@@ {s}")
if s:
return CustomDataType(s)

if re.match(r"^(type|object|function)$", dtype_str):
return ModifierDataType("typing.Any")

Expand Down

0 comments on commit 343c822

Please sign in to comment.