diff --git a/src/idl_gen_python.cpp b/src/idl_gen_python.cpp index 1c814cd53cf..19b4a520ce3 100644 --- a/src/idl_gen_python.cpp +++ b/src/idl_gen_python.cpp @@ -2686,14 +2686,11 @@ class PythonGenerator : public BaseGenerator { bool SaveType(const std::string &defname, const Namespace &ns, const std::string &classcode, const ImportMap &imports, const std::string &mod, bool needs_imports) const { + if (classcode.empty()) return true; + std::string code = ""; - if (classcode.empty()) { - BeginFile(LastNamespacePart(ns), false, &code, "", {}); - code += "# NOTE " + defname + " does not declare any structs or enums\n"; - } else { - BeginFile(LastNamespacePart(ns), needs_imports, &code, mod, imports); - code += classcode; - } + BeginFile(LastNamespacePart(ns), needs_imports, &code, mod, imports); + code += classcode; const std::string directories = parser_.opts.one_file ? path_ : namer_.Directories(ns.components); diff --git a/tests/FromInclude.py b/tests/FromInclude.py deleted file mode 100644 index dbfcbffe797..00000000000 --- a/tests/FromInclude.py +++ /dev/null @@ -1,5 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: OtherNameSpace - -# NOTE FromInclude.py does not declare any structs or enums diff --git a/tests/MyGame/OtherNameSpace/FromInclude.py b/tests/MyGame/OtherNameSpace/FromInclude.py deleted file mode 100644 index dbfcbffe797..00000000000 --- a/tests/MyGame/OtherNameSpace/FromInclude.py +++ /dev/null @@ -1,5 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: OtherNameSpace - -# NOTE FromInclude.py does not declare any structs or enums diff --git a/tests/MyGame/OtherNameSpace/TableB.py b/tests/MyGame/OtherNameSpace/TableB.py deleted file mode 100644 index 1a30369384f..00000000000 --- a/tests/MyGame/OtherNameSpace/TableB.py +++ /dev/null @@ -1,5 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: OtherNameSpace - -# NOTE TableB.py does not declare any structs or enums diff --git a/tests/MyGame/OtherNameSpace/Unused.py b/tests/MyGame/OtherNameSpace/Unused.py deleted file mode 100644 index bde02a74739..00000000000 --- a/tests/MyGame/OtherNameSpace/Unused.py +++ /dev/null @@ -1,5 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: OtherNameSpace - -# NOTE Unused.py does not declare any structs or enums diff --git a/tests/MyGame/OtherNameSpace/__init__.py b/tests/MyGame/OtherNameSpace/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/TableA.py b/tests/TableA.py deleted file mode 100644 index ea081ffdc12..00000000000 --- a/tests/TableA.py +++ /dev/null @@ -1,5 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: - -# NOTE TableA.py does not declare any structs or enums diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000