]> granicus.if.org Git - python/commitdiff
Merged revisions 80880 via svnmerge from
authorGiampaolo Rodolà <g.rodola@gmail.com>
Thu, 6 May 2010 20:02:37 +0000 (20:02 +0000)
committerGiampaolo Rodolà <g.rodola@gmail.com>
Thu, 6 May 2010 20:02:37 +0000 (20:02 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80880 | giampaolo.rodola | 2010-05-06 21:56:34 +0200 (gio, 06 mag 2010) | 1 line

  provides a clearer warning message when cheap inheritance with the underlying socket object is used
........

Lib/asyncore.py

index 3dad594804c778e6a32a6e0b62ef960c672ff59d..ac0b75523571cae77de859344ebb329bbe890c64 100644 (file)
@@ -407,8 +407,9 @@ class dispatcher:
             raise AttributeError("%s instance has no attribute '%s'"
                                  %(self.__class__.__name__, attr))
         else:
-            warnings.warn("cheap inheritance is deprecated", DeprecationWarning,
-                          stacklevel=2)
+            msg = "%(me)s.%(attr)s is deprecated; use %(me)s.socket.%(attr)s " \
+                  "instead" % {'me' : self.__class__.__name__, 'attr' : attr}
+            warnings.warn(msg, DeprecationWarning, stacklevel=2)
             return retattr
 
     # log and log_info may be overridden to provide more sophisticated