mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-08-22 18:24:10 -05:00
use try/except on globals.asm for preprocessing
This commit is contained in:
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user