summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutil/decode_packet_trace.py11
-rwxr-xr-xutil/encode_packet_trace.py11
2 files changed, 18 insertions, 4 deletions
diff --git a/util/decode_packet_trace.py b/util/decode_packet_trace.py
index fa0ea9604..da9a7aa83 100755
--- a/util/decode_packet_trace.py
+++ b/util/decode_packet_trace.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# Copyright (c) 2013 ARM Limited
+# Copyright (c) 2013-2014 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
@@ -92,8 +92,15 @@ except:
error = call(['protoc', '--python_out=util', '--proto_path=src/proto',
'src/proto/packet.proto'])
if not error:
- import packet_pb2
print "Generated packet proto definitions"
+
+ try:
+ import google.protobuf
+ except:
+ print "Please install Python protobuf module"
+ exit(-1)
+
+ import packet_pb2
else:
print "Failed to import packet proto definitions"
exit(-1)
diff --git a/util/encode_packet_trace.py b/util/encode_packet_trace.py
index fc6ddf7fd..13057a13d 100755
--- a/util/encode_packet_trace.py
+++ b/util/encode_packet_trace.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# Copyright (c) 2013 ARM Limited
+# Copyright (c) 2013-2014 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
@@ -97,8 +97,15 @@ except:
error = call(['protoc', '--python_out=util', '--proto_path=src/proto',
'src/proto/packet.proto'])
if not error:
- import packet_pb2
print "Generated packet proto definitions"
+
+ try:
+ import google.protobuf
+ except:
+ print "Please install the Python protobuf module"
+ exit(-1)
+
+ import packet_pb2
else:
print "Failed to import packet proto definitions"
exit(-1)