@@ -1101,7 +1101,7 @@ def __init__(self, bbox, transform, **kwargs):
1101
1101
bbox : `Bbox`
1102
1102
transform : `Transform`
1103
1103
"""
1104
- if not bbox .is_bbox :
1104
+ if not hasattr ( bbox , 'is_bbox' ) or not bbox .is_bbox :
1105
1105
raise ValueError ("'bbox' is not a bbox" )
1106
1106
_api .check_isinstance (Transform , transform = transform )
1107
1107
if transform .input_dims != 2 or transform .output_dims != 2 :
@@ -1190,7 +1190,7 @@ def __init__(self, bbox, x0=None, y0=None, x1=None, y1=None, **kwargs):
1190
1190
The locked value for y1, or None to leave unlocked.
1191
1191
1192
1192
"""
1193
- if not bbox .is_bbox :
1193
+ if not hasattr ( bbox , 'is_bbox' ) or not bbox .is_bbox :
1194
1194
raise ValueError ("'bbox' is not a bbox" )
1195
1195
1196
1196
super ().__init__ (** kwargs )
@@ -2547,7 +2547,8 @@ def __init__(self, boxin, boxout, **kwargs):
2547
2547
Create a new `BboxTransform` that linearly transforms
2548
2548
points from *boxin* to *boxout*.
2549
2549
"""
2550
- if not boxin .is_bbox or not boxout .is_bbox :
2550
+ if (not hasattr (boxin , 'is_bbox' ) or not hasattr (boxout , 'is_bbox' ) or
2551
+ not boxin .is_bbox or not boxout .is_bbox ):
2551
2552
raise ValueError ("'boxin' and 'boxout' must be bbox" )
2552
2553
2553
2554
super ().__init__ (** kwargs )
@@ -2591,7 +2592,7 @@ def __init__(self, boxout, **kwargs):
2591
2592
Create a new `BboxTransformTo` that linearly transforms
2592
2593
points from the unit bounding box to *boxout*.
2593
2594
"""
2594
- if not boxout .is_bbox :
2595
+ if not hasattr ( boxout , 'is_bbox' ) or not boxout .is_bbox :
2595
2596
raise ValueError ("'boxout' must be bbox" )
2596
2597
2597
2598
super ().__init__ (** kwargs )
@@ -2645,7 +2646,7 @@ class BboxTransformFrom(Affine2DBase):
2645
2646
is_separable = True
2646
2647
2647
2648
def __init__ (self , boxin , ** kwargs ):
2648
- if not boxin .is_bbox :
2649
+ if not hasattr ( boxin , 'is_bbox' ) or not boxin .is_bbox :
2649
2650
raise ValueError ("'boxin' must be bbox" )
2650
2651
2651
2652
super ().__init__ (** kwargs )
0 commit comments