diff options
author | Giampaolo RodolĂ <g.rodola@gmail.com> | 2010-05-06 19:56:34 (GMT) |
---|---|---|
committer | Giampaolo RodolĂ <g.rodola@gmail.com> | 2010-05-06 19:56:34 (GMT) |
commit | 215b6b392d8530dee3e33caf12249dadfe71c07f (patch) | |
tree | 1a50535b6ba02ccb0102d4837b6348fdb839e457 /Lib | |
parent | f7454fa98dfe5d2c3d59437aade27b5daa6208c5 (diff) | |
download | cpython-215b6b392d8530dee3e33caf12249dadfe71c07f.zip cpython-215b6b392d8530dee3e33caf12249dadfe71c07f.tar.gz cpython-215b6b392d8530dee3e33caf12249dadfe71c07f.tar.bz2 |
provides a clearer warning message when cheap inheritance with the underlying socket object is used
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/asyncore.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 5aec688..ce18d83 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 |