Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSC: Remove deprecated protobuf python MessageFactory.CreatePrototype() usages #180

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pybind11_protobuf/tests/dynamic_message_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from pybind11_protobuf.tests import test_pb2

POOL = descriptor_pool.DescriptorPool()
FACTORY = message_factory.MessageFactory(POOL)
POOL.Add(
descriptor_pb2.FileDescriptorProto(
name='pybind11_protobuf/tests',
Expand All @@ -42,16 +41,18 @@

def get_py_dynamic_message(value=5):
"""Returns a dynamic message that is wire-compatible with IntMessage."""
prototype = FACTORY.CreatePrototype(
POOL.FindMessageTypeByName('pybind11.test.DynamicMessage'))
prototype = message_factory.GetMessageClass(
POOL.FindMessageTypeByName('pybind11.test.DynamicMessage')
)
msg = prototype(value=value)
return msg


def get_py_dynamic_int_message(value=5):
"""Returns a dynamic message named pybind11.test.IntMessage."""
prototype = FACTORY.CreatePrototype(
POOL.FindMessageTypeByName('pybind11.test.IntMessage'))
prototype = message_factory.GetMessageClass(
POOL.FindMessageTypeByName('pybind11.test.IntMessage')
)
msg = prototype(value=value)
return msg

Expand Down
Loading