summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2017-02-25 21:31:06 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2017-02-25 21:31:06 +0200
commitab6017e195c9f0aa5209feafac54f0cb5f5315d4 (patch)
tree2537c72ef0b612bc24771c0bee874e0b1bf582f2
parent9fdea3a35e5b0153bf4e651a1a2a1b8f3f4bad50 (diff)
Add better error message on Python library version imcompatibility (issue #240)
-rwxr-xr-xgenerator/nanopb_generator.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 9cce6a5a..b5473174 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -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('''
********************************************************************