Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 45da1c5

Browse files
committed
Don't perform retey in convert_units
1 parent 7359ece commit 45da1c5

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

lib/matplotlib/axis.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,12 +1555,9 @@ def convert_units(self, x):
15551555
# DecimalConverter may raise error, so check here to walk around.
15561556
if munits.ConversionInterface.is_numlike(x):
15571557
return x
1558-
# Try convert again
1559-
try:
1560-
ret = self.converter.convert(x, self.units, self)
1561-
except Exception as e2:
1562-
raise munits.ConversionError('Failed to convert value(s) to '
1563-
f'axis units: {x!r}') from e2
1558+
# Otherwise, the conversion fails
1559+
raise munits.ConversionError('Failed to convert value(s) to '
1560+
f'axis units: {x!r}') from e
15641561
return ret
15651562

15661563
def set_units(self, u):

0 commit comments

Comments
 (0)