Kaydet (Commit) 215b6b39 authored tarafından Giampaolo Rodolà's avatar Giampaolo Rodolà

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

üst f7454fa9
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment