summaryrefslogtreecommitdiff
path: root/pokemontools/labels.py
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-02-13 18:09:31 -0500
committerGitHub <noreply@github.com>2017-02-13 18:09:31 -0500
commit979c98a7c0f67ad6b9685b2d532c66a1f76ffb22 (patch)
treec67cc7b8500aac4e400d4e8bfdbef57a57b63eb1 /pokemontools/labels.py
parent74c620d01ad59bfb09cf4111ace549b925fcb9ab (diff)
parent766dea11bd63dee939db2b47198410e6c6e0fc7e (diff)
Merge pull request #103 from eevee/py3
Python 3 compatibility, sort of, maybe
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 69be4b1..f8e8ec2 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: