diff --git a/lib/matplotlib/category.py b/lib/matplotlib/category.py index 2fe39425224e..55af459fd575 100644 --- a/lib/matplotlib/category.py +++ b/lib/matplotlib/category.py @@ -179,7 +179,8 @@ def _str_is_convertible(val): except ValueError: try: dateutil.parser.parse(val) - except ValueError: + except (ValueError, TypeError): + # TypeError if dateutil >= 2.8.1 else ValueError return False return True