From f7be519e08d2c699e02aee691b3351441040df92 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Henrique=20Mendon=C3=A7a?= Date: Thu, 19 Sep 2013 12:30:05 +0200 Subject: [PATCH] THRIFT-1772 Serialization does not check types of embedded structures. Client: python Patch: Avi Flamholz clean up references to php only, no functional changes --- compiler/cpp/src/generate/t_py_generator.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/compiler/cpp/src/generate/t_py_generator.cc b/compiler/cpp/src/generate/t_py_generator.cc index 4a540f27..e2151953 100644 --- a/compiler/cpp/src/generate/t_py_generator.cc +++ b/compiler/cpp/src/generate/t_py_generator.cc @@ -949,8 +949,7 @@ void t_py_generator::generate_py_struct_writer(ofstream& out, const vector& fields = tstruct->get_sorted_members(); vector::const_iterator f_iter; - indent(out) << - "def write(self, oprot):" << endl; + indent(out) << "def write(self, oprot):" << endl; indent_up(); indent(out) << @@ -1062,7 +1061,7 @@ void t_py_generator::generate_service(t_service* tservice) { f_service_ << endl; - // Generate the three main parts of the service (well, two for now in PHP) + // Generate the three main parts of the service generate_service_interface(tservice); generate_service_client(tservice); generate_service_server(tservice); @@ -2180,7 +2179,7 @@ void t_py_generator::generate_deserialize_field(ofstream &out, out << "readDouble();"; break; default: - throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase); + throw "compiler error: no Python name for base type " + t_base_type::t_base_name(tbase); } } else if (type->is_enum()) { out << "readI32();"; @@ -2378,7 +2377,7 @@ void t_py_generator::generate_serialize_field(ofstream &out, out << "writeDouble(" << name << ")"; break; default: - throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase); + throw "compiler error: no Python name for base type " + t_base_type::t_base_name(tbase); } } else if (type->is_enum()) { out << "writeI32(" << name << ")"; @@ -2402,8 +2401,7 @@ void t_py_generator::generate_serialize_struct(ofstream &out, t_struct* tstruct, string prefix) { (void) tstruct; - indent(out) << - prefix << ".write(oprot)" << endl; + indent(out) << prefix << ".write(oprot)" << endl; } void t_py_generator::generate_serialize_container(ofstream &out, -- 2.17.1