I'm not sure I understand. What would you expect the import line importing a_pb2 to look like? My understanding is that Python imports are absolute, not relative to the importing file.
On Sat, Oct 25, 2008 at 7:11 PM, Alan Kligman <[EMAIL PROTECTED]>wrote: > > I'm having a problem with protoc where python imports are not done > correctly. Here's the situation: > > I have a directory structure like this: > > proto/a.proto > proto/a/b.proto > proto/a/c.proto > > a.proto provides some common definitions for both b.proto and c.proto. > I build the output like this: > > protoc --proto_path=. --python_out=../dist *.proto > protoc --proto_path=. --python_out=../dist a/*.proto > > assuming that proto is the current directory. Because a.proto is > included in both b.proto and c.proto, they both import it like this: > > import "a.proto"; # relative to the current directory > > After building the protobuf files with protoc, the resulting python > output has import statements for a_pb2.py that look like: > > import a_pb2.py > > which is wrong, because a_pb2.py is actually in the directory one > above b_pb2.py and c_pb2.py. Is there a way to get protoc to do this > properly? Is it a bug? Python2.5 handles relative imports, but there > is no nice way to do it in python2.4. > > Thoughts? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~----------~----~----~----~------~----~------~--~---