|
From: <jd...@us...> - 2009-11-06 15:01:03
|
Revision: 7940
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7940&view=rev
Author: jdh2358
Date: 2009-11-06 15:00:57 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
fix to int in afm to not crash on floats
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/afm.py
Modified: trunk/matplotlib/lib/matplotlib/afm.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/afm.py 2009-11-06 13:05:13 UTC (rev 7939)
+++ trunk/matplotlib/lib/matplotlib/afm.py 2009-11-06 15:00:57 UTC (rev 7940)
@@ -38,7 +38,13 @@
from _mathtext_data import uni2type1
#Convert string the a python type
-_to_int = int
+
+# some afm files have floats where we are expecting ints -- there is
+# probably a better way to handle this (support floats, round rather
+# than truncate). But I don't know what the best approach is now and
+# this change to _to_int should at least prevent mpl from crashing on
+# these JDH (2009-11-06)
+_to_int = lambda x: return int(float(x))
_to_float = float
_to_str = str
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|