mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-02 14:28:18 +00:00
[Python] Verify EnumDef is not generated in GenUnionCreator (#6903)
* [Python] Verify EnumDef is not generated in GenUnionCreator * update test output
This commit is contained in:
@@ -1595,6 +1595,8 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
|
|
||||||
// Creates an union object based on union type.
|
// Creates an union object based on union type.
|
||||||
void GenUnionCreator(const EnumDef &enum_def, std::string *code_ptr) {
|
void GenUnionCreator(const EnumDef &enum_def, std::string *code_ptr) {
|
||||||
|
if (enum_def.generated) return;
|
||||||
|
|
||||||
auto &code = *code_ptr;
|
auto &code = *code_ptr;
|
||||||
auto union_name = MakeUpperCamel(enum_def);
|
auto union_name = MakeUpperCamel(enum_def);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
# namespace: NamespaceB
|
# namespace: NamespaceB
|
||||||
|
|
||||||
|
class UnionInNestedNS(object):
|
||||||
|
NONE = 0
|
||||||
|
TableInNestedNS = 1
|
||||||
|
|
||||||
|
|
||||||
def UnionInNestedNSCreator(unionType, table):
|
def UnionInNestedNSCreator(unionType, table):
|
||||||
from flatbuffers.table import Table
|
from flatbuffers.table import Table
|
||||||
|
|||||||
Reference in New Issue
Block a user