From dec5ab30361d0518ca90e2b7df46519403c9b4ea Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Wed, 6 Jun 2018 17:55:18 -0400 Subject: [PATCH] py36 we also need to put py36 in externals --- src/lib/api/service_compiler/plugin.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/api/service_compiler/plugin.py b/src/lib/api/service_compiler/plugin.py index 2a019710e..78c78d98e 100755 --- a/src/lib/api/service_compiler/plugin.py +++ b/src/lib/api/service_compiler/plugin.py @@ -1,4 +1,5 @@ #!/usr/bin/python +from __future__ import print_function import os, sys from collections import namedtuple @@ -30,8 +31,8 @@ import apioptions_pb2 def loadTemplate(lang, name): path = os.path.join("templates", lang, name) text = open(path).read() - utext = unicode(text, "utf-8") - return compiler.compile(utext) + #utext = unicode(text, "utf-8") + return compiler.compile(text) def option(options, key, default=None): if options.HasExtension(key): @@ -307,7 +308,7 @@ if __name__ == "__main__": if DEBUG: data = open("data", mode='rb').read() else: - data = sys.stdin.read() + data = sys.stdin.buffer.read() request = plugin.CodeGeneratorRequest() # open("data", 'wb').write(data) request.ParseFromString(data) @@ -316,8 +317,8 @@ if __name__ == "__main__": if DEBUG: for f in response.file: - print f.content + print(f.content) else: output = response.SerializeToString() - sys.stdout.write(output) + sys.stdout.buffer.write(output)