]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
provides a clearer warning message when cheap inheritance with the underlying socket...
authorGiampaolo Rodolà <g.rodola@gmail.com>
Thu, 6 May 2010 19:56:34 +0000 (19:56 +0000)
committerGiampaolo Rodolà <g.rodola@gmail.com>
Thu, 6 May 2010 19:56:34 +0000 (19:56 +0000)
Lib/asyncore.py

index 5aec688de5842794c713876535bcd0365affb3b1..ce18d8317328ac7f63b8250b53f646244dcadd5b 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