-#!/usr/bin/env python2
+#!/usr/bin/env python3
# Copyright (c) 2013 ARM Limited
# All rights reserved
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Authors: Andreas Hansson
-# Radhika Jagtap
# This file is a library of commonly used functions used when interfacing
# with protobuf python messages. For eg, the decode scripts for different
except IOError:
proto_in = open(in_file, 'rb')
except IOError:
- print "Failed to open ", in_file, " for reading"
+ print("Failed to open ", in_file, " for reading")
exit(-1)
return proto_in
bits = value & 0x7f
value >>= 7
while value:
- out_file.write(struct.pack('<B', 0x80|bits))
+ out_file.write(struct.pack('<B', 0x80 | bits))
bits = value & 0x7f
value >>= 7
out_file.write(struct.pack('<B', bits))