diff options
-rw-r--r-- | host/python/uhd/usrp/cal/usrp_calibrator.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/host/python/uhd/usrp/cal/usrp_calibrator.py b/host/python/uhd/usrp/cal/usrp_calibrator.py index a665564ba..f409072d4 100644 --- a/host/python/uhd/usrp/cal/usrp_calibrator.py +++ b/host/python/uhd/usrp/cal/usrp_calibrator.py @@ -411,11 +411,9 @@ def get_usrp_calibrator(usrp, meas_dev, direction, **kwargs): raise RuntimeError("Could not determine USRP type!") print("=== Detected USRP type:", usrp_type) for _, obj in inspect.getmembers(sys.modules[__name__]): - try: - if issubclass(obj, USRPCalibratorBase) \ - and usrp_type in getattr(obj, 'mboard_ids', ''): - return obj(usrp, meas_dev, direction, **kwargs) - except TypeError: - continue + if (inspect.isclass(obj) and + issubclass(obj, USRPCalibratorBase) and + usrp_type in getattr(obj, 'mboard_ids', '')): + return obj(usrp, meas_dev, direction, **kwargs) raise RuntimeError("No USRP calibrator object found for device type: {}" .format(usrp_type)) |