mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-06 06:45:00 +01:00
[compat, networking] Deprecate old functions (#2861)
Authored by: coletdjnz, pukkandan
This commit is contained in:
parent
227bf1a33b
commit
3d2623a898
176 changed files with 707 additions and 729 deletions
|
|
@ -24,6 +24,7 @@ from .exceptions import (
|
|||
from ..utils import (
|
||||
bug_reports_message,
|
||||
classproperty,
|
||||
deprecation_warning,
|
||||
error_to_str,
|
||||
escape_url,
|
||||
update_url_query,
|
||||
|
|
@ -507,16 +508,21 @@ class Response(io.IOBase):
|
|||
# The following methods are for compatability reasons and are deprecated
|
||||
@property
|
||||
def code(self):
|
||||
deprecation_warning('Response.code is deprecated, use Response.status', stacklevel=2)
|
||||
return self.status
|
||||
|
||||
def getcode(self):
|
||||
deprecation_warning('Response.getcode() is deprecated, use Response.status', stacklevel=2)
|
||||
return self.status
|
||||
|
||||
def geturl(self):
|
||||
deprecation_warning('Response.geturl() is deprecated, use Response.url', stacklevel=2)
|
||||
return self.url
|
||||
|
||||
def info(self):
|
||||
deprecation_warning('Response.info() is deprecated, use Response.headers', stacklevel=2)
|
||||
return self.headers
|
||||
|
||||
def getheader(self, name, default=None):
|
||||
deprecation_warning('Response.getheader() is deprecated, use Response.get_header', stacklevel=2)
|
||||
return self.get_header(name, default)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue