mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-06 13:37:25 +00:00
Add self.assertNotNested() in CreateString
And also add a test case. If you try to nest CreateString you will get a clear exception.
This commit is contained in:
@@ -350,6 +350,8 @@ class Builder(object):
|
||||
def CreateString(self, s):
|
||||
"""CreateString writes a null-terminated byte string as a vector."""
|
||||
|
||||
self.assertNotNested()
|
||||
|
||||
if isinstance(s, compat.string_types):
|
||||
x = s.encode()
|
||||
elif isinstance(s, compat.binary_type):
|
||||
|
||||
Reference in New Issue
Block a user