File tree 2 files changed +9
-13
lines changed 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -100,4 +100,9 @@ deprecation warning.
100
100
101
101
Previously setting the *ecolor * would turn off automatic color cycling for the plot, leading to the
102
102
the lines and markers defaulting to whatever the first color in the color cycle was in the case of
103
- multiple plot calls.
103
+ multiple plot calls.
104
+
105
+ `.rcsetup.validate_color_for_prop_cycle ` now always raises TypeError for bytes input
106
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107
+ It previously raised `TypeError `, **except ** when the input was of the form
108
+ ``b"C[number]" `` in which case it raised a ValueError.
Original file line number Diff line number Diff line change @@ -321,18 +321,9 @@ def validate_color_or_auto(s):
321
321
322
322
323
323
def validate_color_for_prop_cycle (s ):
324
- # Special-case the N-th color cycle syntax, this obviously can not
325
- # go in the color cycle.
326
- if isinstance (s , bytes ):
327
- match = re .match (b'^C[0-9]$' , s )
328
- if match is not None :
329
- raise ValueError ('Can not put cycle reference ({cn!r}) in '
330
- 'prop_cycler' .format (cn = s ))
331
- elif isinstance (s , str ):
332
- match = re .match ('^C[0-9]$' , s )
333
- if match is not None :
334
- raise ValueError ('Can not put cycle reference ({cn!r}) in '
335
- 'prop_cycler' .format (cn = s ))
324
+ # N-th color cycle syntax can't go into the color cycle.
325
+ if isinstance (s , str ) and re .match ("^C[0-9]$" , s ):
326
+ raise ValueError (f"Cannot put cycle reference ({ s !r} ) in prop_cycler" )
336
327
return validate_color (s )
337
328
338
329
You can’t perform that action at this time.
0 commit comments