Make exception more readable.

This commit is contained in:
Matt Guthaus 2019-12-16 12:07:40 -08:00
parent f30d0b9197
commit acbbbe9403
1 changed files with 2 additions and 4 deletions

View File

@ -36,18 +36,16 @@ class sram_factory:
A generic function to create a module with a given module_type. A generic function to create a module with a given module_type.
The args are passed directly to the module constructor. The args are passed directly to the module constructor.
""" """
real_module_type = module_type
try: try:
from tech import tech_modules from tech import tech_modules
real_module_type = tech_modules[module_type] real_module_type = tech_modules[module_type]
except ImportError: except ImportError:
# If they didn't define these, then don't use the option types. # If they didn't define these, then don't use the option types.
# Primarily for backward compatibility and simplicity of tech files. # Primarily for backward compatibility and simplicity of tech files.
pass real_module_type = module_type
except KeyError: except KeyError:
# If it wasn't a tech module type, we can ignore that too. # If it wasn't a tech module type, we can ignore that too.
pass real_module_type = module_type
if hasattr(OPTS, module_type): if hasattr(OPTS, module_type):
# Retrieve the name from OPTS if it exists, # Retrieve the name from OPTS if it exists,