summaryrefslogtreecommitdiff
path: root/examples/romanNumerals.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2019-01-09 17:18:22 -0600
committerptmcg <ptmcg@austin.rr.com>2019-01-09 17:18:22 -0600
commitd626c99b6288afc4708d72f668b45a29d3263d22 (patch)
tree4cbeca134437387022e59b71631246e178393aca /examples/romanNumerals.py
parente9ef507bf1fd41d4bd3ffb0c193e5889254ba340 (diff)
downloadpyparsing-git-d626c99b6288afc4708d72f668b45a29d3263d22.tar.gz
Add enumerated place holders for strings that invoke str.format(), for Py2 compatibility
Diffstat (limited to 'examples/romanNumerals.py')
-rw-r--r--examples/romanNumerals.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/romanNumerals.py b/examples/romanNumerals.py
index 0f15ac8..8765055 100644
--- a/examples/romanNumerals.py
+++ b/examples/romanNumerals.py
@@ -57,14 +57,14 @@ expected = 1
for t,s,e in romanNumeral.scanString(tests):
orig = tests[s:e]
if t[0] != expected:
- print("{} {} {}".format("==>", t, orig))
+ print("{0} {1} {2}".format("==>", t, orig))
roman_int_map[orig] = t[0]
expected += 1
def verify_value(s, tokens):
expected = roman_int_map[s]
if tokens[0] != expected:
- raise Exception("incorrect value for {} ({}), expected {}".format(s, tokens[0], expected ))
+ raise Exception("incorrect value for {0} ({1}), expected {2}".format(s, tokens[0], expected ))
romanNumeral.runTests("""\
XVI