wram: return an empty dict for missing constants files

This commit is contained in:
yenatch 2013-12-25 06:54:52 -05:00
parent d983b8a02a
commit 020ae38d34

View File

@ -117,10 +117,10 @@ def read_constants(filepath):
""" """
Load lines from a file and call scrape_constants. Load lines from a file and call scrape_constants.
""" """
lines = None lines = []
if os.path.exists(filepath):
with open(filepath, "r") as file_handler: with open(filepath, "r") as file_handler:
lines = file_handler.readlines() lines = file_handler.readlines()
constants = scrape_constants(lines) constants = scrape_constants(lines)
return constants return constants