Skip to content

Commit

Permalink
Fix: Build Error
Browse files Browse the repository at this point in the history
  • Loading branch information
nutti committed Nov 3, 2023
1 parent ce41acd commit f00b9ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
12 changes: 4 additions & 8 deletions src/fake_bpy_module/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,12 +1364,12 @@ def _get_refined_data_type_fast(
if re.match(r"^Depends on function prototype", dtype_str):
return ModifierDataType("typing.Any")

# [Pattern] `bpy.types.AnyType`
# [Pattern] `AnyType`
# [Test]
# File: refiner_test.py
# Function: test_get_refined_data_type_for_various_patterns
# Pattern: `bpy.types.AnyType`
if re.match(r"`bpy.types.AnyType`", dtype_str):
# Pattern: `AnyType`
if dtype_str == "`AnyType`":
return ModifierDataType("typing.Any")

if re.match(r"^(any|Any type.)$", dtype_str):
Expand Down Expand Up @@ -1524,11 +1524,7 @@ def _get_refined_data_type_fast(
m = re.match(r"(int|float)$", dtype_str)
if m:
return BuiltinDataType(m.group(1))
m = re.match(r"^unsigned int$", dtype_str)
if m:
return BuiltinDataType("int")
m = re.match(r"^int \(boolean\)$", dtype_str)
if m:
if dtype_str in ("unsigned int", "int (boolean)"):
return BuiltinDataType("int")
m = re.match(r"^int sequence$", dtype_str)
if m:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,9 @@ def test_get_refined_data_type_for_various_patterns(self):
self.assertEqual(dt.modifier_data_type(), "typing.Callable")
self.assertEqual(dt.to_string(), "typing.Callable")

# Pattern: `bpy.types.AnyType`
# Pattern: `AnyType`
# Ref: https://github.com/nutti/fake-bpy-module/issues/141
intermidiate_data_type = IntermidiateDataType(
"`bpy.types.AnyType`")
intermidiate_data_type = IntermidiateDataType("`AnyType`")
refined_data_type = refiner.get_refined_data_type(
intermidiate_data_type, "module_1", 'FUNC_ARG')
self.assertEqual(refined_data_type.type(), 'MODIFIER')
Expand Down

0 comments on commit f00b9ba

Please sign in to comment.