src/reportlab/lib/attrmap.py
branchpy33
changeset 3721 0c93dd8ff567
parent 3617 ae5744e97c42
child 3723 99aa837b6703
--- a/src/reportlab/lib/attrmap.py	Fri Feb 15 15:54:16 2013 +0000
+++ b/src/reportlab/lib/attrmap.py	Tue Apr 30 14:20:22 2013 +0100
@@ -50,7 +50,7 @@
         self.desc = desc
         self._initial = initial
         self._advancedUsage = advancedUsage
-        for k,v in kw.items():
+        for k,v in list(kw.items()):
             setattr(self,k,v)
 
     def __getattr__(self,name):
@@ -60,10 +60,10 @@
             return self._initial
         elif name=='hidden':
             return 0
-        raise AttributeError, name
+        raise AttributeError(name)
 
     def __repr__(self):
-        return 'AttrMapValue(%s)' % ', '.join(['%s=%r' % i for i in self.__dict__.iteritems()])
+        return 'AttrMapValue(%s)' % ', '.join(['%s=%r' % i for i in self.__dict__.items()])
 
 class AttrMap(UserDict):
     def __init__(self,BASE=None,UNWANTED=[],**kw):
@@ -77,7 +77,7 @@
                     if hasattr(B,'_attrMap'):
                         data.update(getattr(B._attrMap,'data',{}))
                     else:
-                        raise ValueError, 'BASE=%s has wrong kind of value' % str(B)
+                        raise ValueError('BASE=%s has wrong kind of value' % str(B))
 
         UserDict.__init__(self,data)
         self.remove(UNWANTED)
@@ -113,9 +113,9 @@
                 try:
                     validate = map[name].validate
                     if not validate(value):
-                        raise AttributeError, "Illegal assignment of '%s' to '%s' in class %s" % (value, name, obj.__class__.__name__)
+                        raise AttributeError("Illegal assignment of '%s' to '%s' in class %s" % (value, name, obj.__class__.__name__))
                 except KeyError:
-                    raise AttributeError, "Illegal attribute '%s' in class %s" % (name, obj.__class__.__name__)
+                    raise AttributeError("Illegal attribute '%s' in class %s" % (name, obj.__class__.__name__))
     obj.__dict__[name] = value
 
 def _privateAttrMap(obj,ret=0):