Remove use of relative paths
[apps/agl-service-can-low-level.git] / generator / nanopb_generator.py
index 9cce6a5..359e184 100755 (executable)
@@ -3,7 +3,7 @@
 from __future__ import unicode_literals
 
 '''Generate header file for nanopb from a ProtoBuf FileDescriptorSet.'''
-nanopb_version = "nanopb-0.3.8-dev"
+nanopb_version = "nanopb-0.3.9-dev"
 
 import sys
 import re
@@ -32,6 +32,20 @@ except:
 try:
     import proto.nanopb_pb2 as nanopb_pb2
     import proto.plugin_pb2 as plugin_pb2
+except TypeError:
+    sys.stderr.write('''
+         ****************************************************************************
+         *** Got TypeError when importing the protocol definitions for generator. ***
+         *** This usually means that the protoc in your path doesn't match the    ***
+         *** Python protobuf library version.                                     ***
+         ***                                                                      ***
+         *** Please check the output of the following commands:                   ***
+         *** which protoc                                                         ***
+         *** protoc --version                                                     ***
+         *** python -c 'import google.protobuf; print(google.protobuf.__file__)'  ***
+         ****************************************************************************
+    ''' + '\n')
+    raise
 except:
     sys.stderr.write('''
          ********************************************************************