diff --git a/pandas/_libs/lib.pyx b/pandas/_libs/lib.pyx index 5b975d14475d5..7f1b772f38185 100644 --- a/pandas/_libs/lib.pyx +++ b/pandas/_libs/lib.pyx @@ -2716,7 +2716,6 @@ def maybe_convert_objects(ndarray[object] objects, if convert_non_numeric: if getattr(val, "tzinfo", None) is not None: seen.datetimetz_ = True - break else: seen.datetime_ = True try: @@ -2724,10 +2723,9 @@ def maybe_convert_objects(ndarray[object] objects, except OutOfBoundsDatetime: # e.g. test_out_of_s_bounds_datetime64 seen.object_ = True - break else: seen.object_ = True - break + break elif is_period_object(val): if convert_non_numeric: seen.period_ = True