src/reportlab/lib/utils.py
changeset 3326 ce725978d11c
parent 3291 bd18d83b4a0d
child 3327 512eb20b0c3d
--- a/src/reportlab/lib/utils.py	Sat Feb 06 09:24:08 2010 +0000
+++ b/src/reportlab/lib/utils.py	Mon Feb 08 18:17:33 2010 +0000
@@ -80,7 +80,7 @@
         except KeyError:
             return dv
 
-    def has_key(self,k):
+    def __contains__(self,k):
         try:
             self[k]
             return True
@@ -293,7 +293,7 @@
         sys.path = opath
         msg = "recursiveimport(%s,baseDir=%s) failed" % (modulename,baseDir)
         if baseDir:
-            msg = msg + " under paths '%s'" % `path`
+            msg = msg + " under paths '%s'" % repr(path)
         raise ImportError, msg
 
 def recursiveGetAttr(obj, name):
@@ -492,7 +492,7 @@
     return time_mktime((y,m,d,h,m,s,0,0,0))
 
 def rl_get_module(name,dir):
-    if sys.modules.has_key(name):
+    if name in sys.modules:
         om = sys.modules[name]
         del sys.modules[name]
     else:
@@ -659,7 +659,7 @@
         if sys.platform[0:4] == 'java':
             return None
         else:
-            if self._image.info.has_key("transparency"):
+            if "transparency" in self._image.info:
                 transparency = self._image.info["transparency"] * 3
                 palette = self._image.palette
                 try: