From d626c99b6288afc4708d72f668b45a29d3263d22 Mon Sep 17 00:00:00 2001 From: ptmcg Date: Wed, 9 Jan 2019 17:18:22 -0600 Subject: Add enumerated place holders for strings that invoke str.format(), for Py2 compatibility --- examples/protobuf_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/protobuf_parser.py') diff --git a/examples/protobuf_parser.py b/examples/protobuf_parser.py index ad5db3a..68a8f63 100644 --- a/examples/protobuf_parser.py +++ b/examples/protobuf_parser.py @@ -17,7 +17,7 @@ LBRACE,RBRACE,LBRACK,RBRACK,LPAR,RPAR,EQ,SEMI = map(Suppress,"{}[]()=;") kwds = """message required optional repeated enum extensions extends extend to package service rpc returns true false option import""" for kw in kwds.split(): - exec("{}_ = Keyword('{}')".format(kw.upper(), kw)) + exec("{0}_ = Keyword('{1}')".format(kw.upper(), kw)) messageBody = Forward() -- cgit v1.2.1