summaryrefslogtreecommitdiff
path: root/pokemontools/labels.py
diff options
context:
space:
mode:
authorEevee (Lexy Munroe) <eevee.git@veekun.com>2016-08-24 15:43:15 -0700
committerEevee (Lexy Munroe) <eevee.git@veekun.com>2016-08-24 15:43:15 -0700
commita64657988a50522885618998e7f14168c299a19b (patch)
tree9240aab0fba75befe75d6059d62bea8a3e0fbd4e /pokemontools/labels.py
parent0e1798937a4bf723813574281d0dc12c471c9199 (diff)
Fix most Python 3 compat issues with futurize --stage1
Diffstat (limited to 'pokemontools/labels.py')
-rw-r--r--pokemontools/labels.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pokemontools/labels.py b/pokemontools/labels.py
index 59a6160..d30c1dc 100644
--- a/pokemontools/labels.py
+++ b/pokemontools/labels.py
@@ -2,13 +2,14 @@
"""
Various label/line-related functions.
"""
+from __future__ import absolute_import
import os
import json
import logging
-import pointers
-import sym
+from . import pointers
+from . import sym
class Labels(object):
"""
@@ -31,7 +32,7 @@ class Labels(object):
if not os.path.exists(self.path):
self.filename = find_symfile_in_dir(self.config.path)
if self.filename == None:
- raise Exception, "Couldn't find any .sym files. Run rgblink -n to create a .sym file."
+ raise Exception("Couldn't find any .sym files. Run rgblink -n to create a .sym file.")
self.path = os.path.join(self.config.path, self.filename)
self.labels = sym.read_symfile(self.path)
@@ -178,7 +179,7 @@ def get_address_from_line_comment(line, bank=None):
def line_has_label(line):
"""returns True if the line has an asm label"""
if not isinstance(line, str):
- raise Exception, "can't check this type of object"
+ raise Exception("can't check this type of object")
line = line.rstrip(" ").lstrip(" ")
line = remove_quoted_text(line)
if ";" in line: