tools/pythonpoint/pythonpoint.py
branchpy33
changeset 3944 96735eb0192b
parent 3794 398ea04239b5
child 3972 b5870c0f3eb4
--- a/tools/pythonpoint/pythonpoint.py	Fri Dec 13 13:58:20 2013 +0000
+++ b/tools/pythonpoint/pythonpoint.py	Fri Dec 13 13:59:14 2013 +0000
@@ -77,7 +77,7 @@
 from reportlab.lib import styles
 from reportlab.lib import colors
 from reportlab.lib.units import cm
-from reportlab.lib.utils import getBytesIO
+from reportlab.lib.utils import getBytesIO, isStr
 from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY
 from reportlab.pdfbase import pdfmetrics
 from reportlab.pdfgen import canvas
@@ -203,9 +203,10 @@
 def checkColor(col):
     "Converts a color name to an RGB tuple, if possible."
 
-    if type(col) == type('') and col in dir(colors):
-        col = getattr(colors, col)
-        col = (col.red, col.green, col.blue)
+    if isStr(col):
+        if col in dir(colors):
+            col = getattr(colors, col)
+            col = (col.red, col.green, col.blue)
 
     return col