src/reportlab/lib/attrmap.py
branchpy33
changeset 3762 4817e577522d
parent 3723 99aa837b6703
child 3763 d079e73fb7b0
--- a/src/reportlab/lib/attrmap.py	Wed Jul 31 16:27:08 2013 +0100
+++ b/src/reportlab/lib/attrmap.py	Thu Aug 01 16:47:07 2013 +0100
@@ -28,7 +28,8 @@
 
 
 '''
-from reportlab.lib.validators import isAnything, _SequenceTypes, DerivedValue
+from reportlab.lib.validators import isAnything, DerivedValue
+from reportlab.lib.utils import isSeq
 from reportlab import rl_config
 
 class CallableValue:
@@ -71,7 +72,7 @@
             if isinstance(BASE,AttrMap):
                 data = BASE.data                        #they used BASECLASS._attrMap
             else:
-                if type(BASE) not in (type(()),type([])): BASE = (BASE,)
+                if not isSeq(BASE): BASE = (BASE,)
                 for B in BASE:
                     if hasattr(B,'_attrMap'):
                         data.update(getattr(B._attrMap,'data',{}))
@@ -156,11 +157,11 @@
     #sanity
     assert hasattr(src,'_attrMap'), 'src object has no _attrMap'
     A, oA = _privateAttrMap(src,1)
-    if type(dst) not in _SequenceTypes: dst = dst,
+    if not isSeq(dst): dst = dst,
     D = []
     DV = []
     for d in dst:
-        if type(d) in _SequenceTypes:
+        if isSeq(d):
             d, e = d[0], d[1:]
         obj, attr = _findObjectAndAttr(src,d)
         if obj: