From acbbbe94031ce62f6fd222d155630a6115961935 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Mon, 16 Dec 2019 12:07:40 -0800 Subject: [PATCH] Make exception more readable. --- compiler/sram_factory.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/sram_factory.py b/compiler/sram_factory.py index f5e19d87..6bb3578c 100644 --- a/compiler/sram_factory.py +++ b/compiler/sram_factory.py @@ -36,18 +36,16 @@ class sram_factory: A generic function to create a module with a given module_type. The args are passed directly to the module constructor. """ - real_module_type = module_type - try: from tech import tech_modules real_module_type = tech_modules[module_type] except ImportError: # If they didn't define these, then don't use the option types. # Primarily for backward compatibility and simplicity of tech files. - pass + real_module_type = module_type except KeyError: # If it wasn't a tech module type, we can ignore that too. - pass + real_module_type = module_type if hasattr(OPTS, module_type): # Retrieve the name from OPTS if it exists,