File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 19
19
from pybind11_protobuf .tests import test_pb2
20
20
21
21
POOL = descriptor_pool .DescriptorPool ()
22
- FACTORY = message_factory .MessageFactory (POOL )
23
22
POOL .Add (
24
23
descriptor_pb2 .FileDescriptorProto (
25
24
name = 'pybind11_protobuf/tests' ,
42
41
43
42
def get_py_dynamic_message (value = 5 ):
44
43
"""Returns a dynamic message that is wire-compatible with IntMessage."""
45
- prototype = FACTORY .CreatePrototype (
46
- POOL .FindMessageTypeByName ('pybind11.test.DynamicMessage' ))
44
+ prototype = message_factory .GetMessageClass (
45
+ POOL .FindMessageTypeByName ('pybind11.test.DynamicMessage' )
46
+ )
47
47
msg = prototype (value = value )
48
48
return msg
49
49
50
50
51
51
def get_py_dynamic_int_message (value = 5 ):
52
52
"""Returns a dynamic message named pybind11.test.IntMessage."""
53
- prototype = FACTORY .CreatePrototype (
54
- POOL .FindMessageTypeByName ('pybind11.test.IntMessage' ))
53
+ prototype = message_factory .GetMessageClass (
54
+ POOL .FindMessageTypeByName ('pybind11.test.IntMessage' )
55
+ )
55
56
msg = prototype (value = value )
56
57
return msg
57
58
You can’t perform that action at this time.
0 commit comments