diff --git a/src/betterproto2_compiler/compile/importing.py b/src/betterproto2_compiler/compile/importing.py index 82bd0a21..814fff71 100644 --- a/src/betterproto2_compiler/compile/importing.py +++ b/src/betterproto2_compiler/compile/importing.py @@ -105,9 +105,9 @@ def get_type_reference( compiling_google_protobuf = current_package == ["google", "protobuf"] importing_google_protobuf = py_package == ["google", "protobuf"] if importing_google_protobuf and not compiling_google_protobuf: - py_package = ["betterproto", "lib"] + (["pydantic"] if pydantic else []) + py_package + py_package = ["betterproto2", "lib"] + (["pydantic"] if pydantic else []) + py_package - if py_package[:1] == ["betterproto"]: + if py_package[:1] == ["betterproto2"]: return reference_absolute(imports, py_package, py_type) if py_package == current_package: