Skip to content

Commit

Permalink
Fix generated EndVector. (google#6385)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhofour committed Jan 5, 2021
1 parent 1bf1ec0 commit 4363c1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/idl_gen_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ class PythonGenerator : public BaseGenerator {
code += Indent + "builder.head = builder.head - len(bytes)\n";
code += Indent + "builder.Bytes[builder.head : builder.head + len(bytes)]";
code += " = bytes\n";
code += Indent + "return builder.EndVector(len(bytes))\n";
code += Indent + "return builder.EndVector()\n";
}

// Get the offset of the end of a table.
Expand Down
4 changes: 2 additions & 2 deletions tests/MyGame/Example/Monster.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def MonsterMakeTestnestedflatbufferVectorFromBytes(builder, bytes):
builder.StartVector(1, len(bytes), 1)
builder.head = builder.head - len(bytes)
builder.Bytes[builder.head : builder.head + len(bytes)] = bytes
return builder.EndVector(len(bytes))
return builder.EndVector()
def MonsterAddTestempty(builder, testempty): builder.PrependUOffsetTRelativeSlot(14, flatbuffers.number_types.UOffsetTFlags.py_type(testempty), 0)
def MonsterAddTestbool(builder, testbool): builder.PrependBoolSlot(15, testbool, 0)
def MonsterAddTesthashs32Fnv1(builder, testhashs32Fnv1): builder.PrependInt32Slot(16, testhashs32Fnv1, 0)
Expand Down Expand Up @@ -840,7 +840,7 @@ def MonsterMakeTestrequirednestedflatbufferVectorFromBytes(builder, bytes):
builder.StartVector(1, len(bytes), 1)
builder.head = builder.head - len(bytes)
builder.Bytes[builder.head : builder.head + len(bytes)] = bytes
return builder.EndVector(len(bytes))
return builder.EndVector()
def MonsterEnd(builder): return builder.EndObject()

import MyGame.Example.Ability
Expand Down

0 comments on commit 4363c1d

Please sign in to comment.