diff options
author | Kevin Wojniak <kainjow@users.noreply.github.com> | 2022-01-22 20:10:26 -0800 |
---|---|---|
committer | Jens Geyer <Jens-G@users.noreply.github.com> | 2022-03-05 09:58:27 +0100 |
commit | 8d6694d60787e2c5e16378e3738a4b31382b6834 (patch) | |
tree | 758f7bf02ca4d092fbc9b4b16072a3062caa6dd2 | |
parent | c4e5dbac2ad1c0020a58dae4968d0ac7dcc188f1 (diff) | |
download | thrift-8d6694d60787e2c5e16378e3738a4b31382b6834.tar.gz |
don't output empty import line if old style enums are used
-rw-r--r-- | compiler/cpp/src/thrift/generate/t_py_generator.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_py_generator.cc b/compiler/cpp/src/thrift/generate/t_py_generator.cc index f330b5092..4457871ff 100644 --- a/compiler/cpp/src/thrift/generate/t_py_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_py_generator.cc @@ -467,10 +467,10 @@ string t_py_generator::py_imports() { << "from thrift.protocol.TProtocol import TProtocolException" << endl << "from thrift.TRecursive import fix_spec" - << endl - << (gen_enum_ ? "from enum import IntEnum" : "") << endl; - + if (gen_enum_) { + ss << "from enum import IntEnum" << endl; + } if (gen_utf8strings_) { ss << endl << "import sys"; } |