Fix Python min alignment

This was accidentally deleted in:
https://github.com/google/flatbuffers/commit/9fa8245e81a2fd8ad19f9ae8f3da3a00e796e462

Change-Id: I8cad721e075279f6a67aca81259f73fb75aba482
This commit is contained in:
Wouter van Oortmerssen
2020-03-09 16:46:41 -07:00
parent 5a98d65e86
commit 89b6183ee9
+7
View File
@@ -514,6 +514,13 @@ class Builder(object):
"""Finish finalizes a buffer, pointing to the given `rootTable`.""" """Finish finalizes a buffer, pointing to the given `rootTable`."""
N.enforce_number(rootTable, N.UOffsetTFlags) N.enforce_number(rootTable, N.UOffsetTFlags)
prepSize = N.UOffsetTFlags.bytewidth
if file_identifier is not None:
prepSize += N.Int32Flags.bytewidth
if sizePrefix:
prepSize += N.Int32Flags.bytewidth
self.Prep(self.minalign, prepSize)
if file_identifier is not None: if file_identifier is not None:
self.Prep(N.UOffsetTFlags.bytewidth, encode.FILE_IDENTIFIER_LENGTH) self.Prep(N.UOffsetTFlags.bytewidth, encode.FILE_IDENTIFIER_LENGTH)