use try/except on globals.asm for preprocessing

This commit is contained in:
Bryan Bishop
2013-09-16 12:40:37 -05:00
parent 4b36a0c41a
commit b67e68c6a1

View File

@@ -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):
"""