summaryrefslogtreecommitdiff
path: root/pokemontools/crystal.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-09-01 15:45:04 -0500
committerBryan Bishop <kanzure@gmail.com>2013-09-01 15:45:04 -0500
commite188fa3eb451c6951ebd6017bd2eb959306f0b60 (patch)
treeba36bec9b11392a7305b93fef7afdb8c86cac01a /pokemontools/crystal.py
parentccc1d82d957bd98ffd60c15410eec67888f5e212 (diff)
make up TextScriptException to replace two asserts
Diffstat (limited to 'pokemontools/crystal.py')
-rw-r--r--pokemontools/crystal.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/pokemontools/crystal.py b/pokemontools/crystal.py
index f21e097..dca30d5 100644
--- a/pokemontools/crystal.py
+++ b/pokemontools/crystal.py
@@ -372,8 +372,15 @@ class TextScript:
logging.debug("cls.last_address is {0}".format(hex(cls.last_address)))
logging.debug("self.last_address is {0}".format(hex(self.last_address)))
- assert self.last_address == (cls.address + cls.size), "the last address should equal the last command's (address + size)"
- assert self.last_address == cls.last_address, "the last address of the TextScript should be the last_address of its last command"
+ if self.last_address != (cls.address + cls.size):
+ raise exceptions.TextScriptException(
+ "the last address should equal the last command's (address + size)"
+ )
+
+ if self.last_address != cls.last_address:
+ raise exceptions.TextScriptException(
+ "the last address of the TextScript should be the last_address of its last command"
+ )
# just some debugging..
if self.debug: