From: Giampaolo RodolĂ  Date: Thu, 6 May 2010 19:56:34 +0000 (+0000) Subject: provides a clearer warning message when cheap inheritance with the underlying socket... X-Git-Tag: v2.7b2~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=215b6b392d8530dee3e33caf12249dadfe71c07f;p=thirdparty%2FPython%2Fcpython.git provides a clearer warning message when cheap inheritance with the underlying socket object is used --- diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 5aec688de584..ce18d8317328 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -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