diff options
author | Adam Cozzette <acozzette@google.com> | 2017-12-01 10:05:10 -0800 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2017-12-01 10:05:10 -0800 |
commit | 92a7e778e7394386f413cec28d67a07630f784b1 (patch) | |
tree | cb5673c7c09b0d3905b48a24765d07e423bc5b30 /python/google/protobuf/descriptor.py | |
parent | ce0a53273a400369932ba788d17500336a6ecaad (diff) |
Integrated internal changes from Google
Diffstat (limited to 'python/google/protobuf/descriptor.py')
-rwxr-xr-x | python/google/protobuf/descriptor.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/google/protobuf/descriptor.py b/python/google/protobuf/descriptor.py index b1f3ca38..0d35425f 100755 --- a/python/google/protobuf/descriptor.py +++ b/python/google/protobuf/descriptor.py @@ -41,8 +41,8 @@ from google.protobuf.internal import api_implementation _USE_C_DESCRIPTORS = False if api_implementation.Type() == 'cpp': # Used by MakeDescriptor in cpp mode + import binascii import os - import uuid from google.protobuf.pyext import _message _USE_C_DESCRIPTORS = getattr(_message, '_USE_C_DESCRIPTORS', False) @@ -952,7 +952,7 @@ def MakeDescriptor(desc_proto, package='', build_file_if_cpp=True, # imported ones. We need to specify a file name so the descriptor pool # accepts our FileDescriptorProto, but it is not important what that file # name is actually set to. - proto_name = str(uuid.uuid4()) + proto_name = binascii.hexlify(os.urandom(16)).decode('ascii') if package: file_descriptor_proto.name = os.path.join(package.replace('.', '/'), |