summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-09-16 12:40:37 -0500
committerBryan Bishop <kanzure@gmail.com>2013-09-16 12:40:37 -0500
commitb67e68c6a16d4ac0b5a23d5d796ad439e727e95c (patch)
treee88e6fed34b419ea11e062306f71700e14cdd101
parent4b36a0c41a220b0dd3563adabe05b861fa7a2130 (diff)
use try/except on globals.asm for preprocessing
-rw-r--r--pokemontools/preprocessor.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/pokemontools/preprocessor.py b/pokemontools/preprocessor.py
index 0cb7f48..5fe0851 100644
--- a/pokemontools/preprocessor.py
+++ b/pokemontools/preprocessor.py
@@ -489,12 +489,16 @@ class Preprocessor(object):
"""
Add any labels not already in globals.asm.
"""
- globes = open(os.path.join(self.config.path, 'globals.asm'), 'r+')
- lines = globes.readlines()
- for globe in self.globes:
- line = 'GLOBAL ' + globe + '\n'
- if line not in lines:
- globes.write(line)
+ # TODO: pokered needs to be fixed
+ try:
+ globes = open(os.path.join(self.config.path, 'globals.asm'), 'r+')
+ lines = globes.readlines()
+ for globe in self.globes:
+ line = 'GLOBAL ' + globe + '\n'
+ if line not in lines:
+ globes.write(line)
+ except Exception as exception:
+ pass # don't care if it's not there...
def read_line(self, l):
"""