summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-08-31 09:50:17 -0500
committerBryan Bishop <kanzure@gmail.com>2013-08-31 09:50:17 -0500
commit2c22d9220c48b2a36550b5a5a2bae1e0988da0d6 (patch)
tree2d3d516c47c7dc5986352e10aa50e9dc9073fdf7
parentecedde19931bd7d1eb71c59498dab98944639b85 (diff)
fix "raise Exception" formatting in preprocessor
-rw-r--r--preprocessor.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/preprocessor.py b/preprocessor.py
index a6a9efd29..905e27533 100644
--- a/preprocessor.py
+++ b/preprocessor.py
@@ -478,7 +478,7 @@ def macro_translator(macro, token, line):
# check if there are no params (redundant)
if len(params) == 1 and params[0] == "":
- raise Exception, "macro has no params?"
+ raise Exception("macro has no params?")
# write out a comment showing the original line
if show_original_lines:
@@ -519,10 +519,14 @@ def macro_translator(macro, token, line):
elif param_klass.size == 3:
allowed_length += 2 # bank and label
else:
- raise Exception, "dunno what to do with a macro param with a size > 3"
+ raise Exception(
+ "dunno what to do with a macro param with a size > 3"
+ )
else:
- raise Exception, "dunno what to do with this non db/dw macro param: " + \
- str(param_klass) + " in line: " + original_line
+ raise Exception(
+ "dunno what to do with this non db/dw macro param: {klass} in line {line}"
+ .format(klass=param_klass, line=original_line)
+ )
# sometimes the allowed length can vary
if hasattr(macro, "allowed_lengths"):
@@ -577,9 +581,13 @@ def macro_translator(macro, token, line):
output += ("db " + param_klass.from_asm(param) + "\n")
index += 1
else:
- raise Exception, "dunno what to do with this macro " + \
- "param (" + str(param_klass) + ") " + "on this line: " + \
- original_line
+ raise Exception(
+ "dunno what to do with this macro param ({klass}) in line: {line}"
+ .format(
+ klass=param_klass,
+ line=original_line,
+ )
+ )
# or just print out the byte
else: