@@ -373,19 +373,18 @@ def wrap(cls: Any) -> Any:
373373 cls_has_array_context_attr : bool | None = _cls_has_array_context_attr
374374 bcast_actx_array_type : bool | None = _bcast_actx_array_type
375375
376- if cls_has_array_context_attr is None :
377- if hasattr (cls , "array_context" ):
378- raise TypeError (
379- f"{ cls } has an 'array_context' attribute, but it does not "
380- "set '_cls_has_array_context_attr' to *True* when calling "
381- "with_container_arithmetic. This is being interpreted "
382- "as '.array_context' being permitted to fail "
383- "with an exception, which is no longer allowed. "
384- f"If { cls .__name__ } .array_context will not fail, pass "
385- "'_cls_has_array_context_attr=True'. "
386- "If you do not want container arithmetic to make "
387- "use of the array context, set "
388- "'_cls_has_array_context_attr=False'." )
376+ if cls_has_array_context_attr is None and hasattr (cls , "array_context" ):
377+ raise TypeError (
378+ f"{ cls } has an 'array_context' attribute, but it does not "
379+ "set '_cls_has_array_context_attr' to *True* when calling "
380+ "with_container_arithmetic. This is being interpreted "
381+ "as '.array_context' being permitted to fail "
382+ "with an exception, which is no longer allowed. "
383+ f"If { cls .__name__ } .array_context will not fail, pass "
384+ "'_cls_has_array_context_attr=True'. "
385+ "If you do not want container arithmetic to make "
386+ "use of the array context, set "
387+ "'_cls_has_array_context_attr=False'." )
389388
390389 if bcast_actx_array_type is None :
391390 if cls_has_array_context_attr :
0 commit comments