diff --git a/smodels/statistics/statsTools.py b/smodels/statistics/statsTools.py index 2b0c4c2b2..b7a275be2 100755 --- a/smodels/statistics/statsTools.py +++ b/smodels/statistics/statsTools.py @@ -223,11 +223,11 @@ def getComputerPyhf(self ): for jsName in globalInfo.jsonFiles: jsonSRs = [] for ir,region in enumerate ( globalInfo.jsonFiles[jsName] ): + if isinstance(region,dict) and not ("type" in region): + region["type"]="SR" if isinstance(region,str): region = { "smodels": region, "type": "SR" } - elif isinstance(region,dict) and not ("type" in region): - region["type"]="SR" - else: + elif not isinstance(region,dict): raise SModelSError("The jsonFiles field should contain lists \ of strings or dictionaries \ (%s is not allowed)" %type(region))