SimplePrinter fails when args are empty
aliafshar opened this issue · comments
The code looks as though it will fail. Do we just want to print an empty line in this case? i.e.
print >>>self.__out, ''
File "./env/bin/gen_client", line 9, in <module>
load_entry_point('apitools==0.2', 'console_scripts', 'gen_client')()
File "/usr/local/google/home/afshar/src/apitools/apitools/gen/gen_client.py", line 214, in run_main
appcommands.Run()
File "/usr/local/google/home/afshar/src/apitools/env/local/lib/python2.7/site-packages/google/apputils/appcommands.py", line 796, in Run
return app.run()
File "/usr/local/google/home/afshar/src/apitools/env/local/lib/python2.7/site-packages/google/apputils/app.py", line 238, in run
return _actual_start()
File "/usr/local/google/home/afshar/src/apitools/env/local/lib/python2.7/site-packages/google/apputils/app.py", line 267, in _actual_start
really_start()
File "/usr/local/google/home/afshar/src/apitools/env/local/lib/python2.7/site-packages/google/apputils/appcommands.py", line 793, in InterceptReallyStart
original_really_start(main=_CommandsStart)
File "/usr/local/google/home/afshar/src/apitools/env/local/lib/python2.7/site-packages/google/apputils/app.py", line 220, in really_start
sys.exit(main(argv))
File "/usr/local/google/home/afshar/src/apitools/env/local/lib/python2.7/site-packages/google/apputils/appcommands.py", line 778, in _CommandsStart
sys.exit(command.CommandRun(GetCommandArgv()))
File "/usr/local/google/home/afshar/src/apitools/env/local/lib/python2.7/site-packages/google/apputils/appcommands.py", line 284, in CommandRun
ret = self.Run(argv)
File "/usr/local/google/home/afshar/src/apitools/apitools/gen/gen_client.py", line 181, in Run
_WriteGeneratedFiles(codegen)
File "/usr/local/google/home/afshar/src/apitools/apitools/gen/gen_client.py", line 158, in _WriteGeneratedFiles
codegen.WriteMessagesFile(out)
File "/usr/local/google/home/afshar/src/apitools/apitools/gen/gen_client_lib.py", line 155, in WriteMessagesFile
self.__message_registry.WriteFile(self._GetPrinter(out))
File "/usr/local/google/home/afshar/src/apitools/apitools/gen/message_registry.py", line 104, in WriteFile
printer)
File "/usr/local/google/home/afshar/src/apitools/apitools/gen/extended_descriptor.py", line 132, in WritePythonFile
_ProtoRpcPrinter(printer))
File "/usr/local/google/home/afshar/src/apitools/apitools/gen/extended_descriptor.py", line 118, in _WriteFile
proto_printer.PrintPreamble(package, version, file_descriptor)
File "/usr/local/google/home/afshar/src/apitools/apitools/gen/extended_descriptor.py", line 318, in PrintPreamble
self.__printer()
File "/usr/local/google/home/afshar/src/apitools/apitools/gen/util.py", line 245, in __call__
print >>self.__out, line