mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
fix isuse #13248: remove previously deprecated asyncore.dispatcher __getattr__ cheap inheritance hack.
This commit is contained in:
parent
63aeb71909
commit
8af740c46a
3 changed files with 3 additions and 31 deletions
|
@ -404,20 +404,6 @@ class dispatcher:
|
|||
if why.args[0] not in (ENOTCONN, EBADF):
|
||||
raise
|
||||
|
||||
# cheap inheritance, used to pass all other attribute
|
||||
# references to the underlying socket object.
|
||||
def __getattr__(self, attr):
|
||||
try:
|
||||
retattr = getattr(self.socket, attr)
|
||||
except AttributeError:
|
||||
raise AttributeError("%s instance has no attribute '%s'"
|
||||
%(self.__class__.__name__, attr))
|
||||
else:
|
||||
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
|
||||
# logging and warning methods. In general, log is for 'hit' logging
|
||||
# and 'log_info' is for informational, warning and error logging.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue