diff --git a/src/uproot/writing/identify.py b/src/uproot/writing/identify.py index 1322b94ba..b1f35b852 100644 --- a/src/uproot/writing/identify.py +++ b/src/uproot/writing/identify.py @@ -265,7 +265,8 @@ def to_writable(obj): data = obj.values(flow=True) fSumw2 = ( obj.variances(flow=True) - if obj.storage_type == boost_histogram.storage.Weight + if boost_histogram is None + or obj.storage_type == boost_histogram.storage.Weight else None ) @@ -293,7 +294,8 @@ def to_writable(obj): tmp = ( obj.variances() - if obj.storage_type == boost_histogram.storage.Weight + if boost_histogram is None + or obj.storage_type == boost_histogram.storage.Weight else None ) fSumw2 = None