Revision: 7942
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7942&view=rev
Author: jdh2358
Date: 2009-11-06 15:04:33 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
backport afm fix to branch
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/afm.py
Modified: branches/v0_99_maint/lib/matplotlib/afm.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/afm.py 2009-11-06 15:02:19 UTC (rev 7941)
+++ branches/v0_99_maint/lib/matplotlib/afm.py 2009-11-06 15:04:33 UTC (rev 7942)
@@ -37,8 +37,16 @@
import sys, os, re
from _mathtext_data import uni2type1
-#Convert string the a python type
-_to_int = int
+# Convert string the a python type
+# 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)
+def _to_int(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.
|