51d50
< import gzip
84,88c83,84
< try:
< # First see if this file is gzipped
< try:
< # Opening the file works even if it is not a gzip file
< proto_in = gzip.open(sys.argv[1], 'rb')
---
> # Open the file in read mode
> proto_in = protolib.openFileRd(sys.argv[1])
90,100d85
< # Force a check of the magic number by seeking in the
< # file. If we do not do it here the error will occur when
< # reading the first message.
< proto_in.seek(1)
< proto_in.seek(0)
< except IOError:
< proto_in = open(sys.argv[1], 'rb')
< except IOError:
< print "Failed to open ", sys.argv[1], " for reading"
< exit(-1)
<