Prepend the config file path so it imports your local copy rather than example_config_freepdk, for example.

This commit is contained in:
Matt Guthaus 2017-11-20 11:57:41 -08:00
parent 76ea89e06f
commit 6873342748
1 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,6 @@ def read_config(config_file):
config file is just a Python file that defines some config
options.
"""
# Create a full path relative to current dir unless it is already an abs path
if not os.path.isabs(config_file):
config_file = os.getcwd() + "/" + config_file
@ -138,7 +137,8 @@ def read_config(config_file):
# Add the path to the system path so we can import things in the other directory
dir_name = os.path.dirname(config_file)
file_name = os.path.basename(config_file)
sys.path.append(dir_name)
# Prepend the path to avoid if we are using the example config
sys.path.insert(0,dir_name)
# Import the configuration file of which modules to use
debug.info(1, "Configuration file is " + config_file + ".py")
try: