Fix import for data.

This commit is contained in:
Tim 'mithro' Ansell 2020-02-23 15:29:46 -08:00
parent 119985f353
commit c96d1e6672
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,9 @@
def find_data(data_type, data_name): def find_data(data_type, data_name):
imp = "from litex.data.{} import {} as dm".format(data_type, data_name) imp = "from litex.data.{} import {} as dm".format(data_type, data_name)
try: try:
exec(imp) l = {}
exec(imp, {}, l)
dm = l['dm']
return dm.data_location return dm.data_location
except ImportError as e: except ImportError as e:
raise ImportError("""\ raise ImportError("""\