def is_valid_bounding_box(bounding_box):
    """Check that a bounding box doesn’t have infinite boundaries."""
    return bounding_box and not isinf(bounding_box[0] + bounding_box[1])
Check that a bounding box doesn’t have infinite boundaries.
weasyprint/svg/bounding_box.py