diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2013-03-19 01:06:00 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2013-03-19 01:06:00 (GMT) |
commit | 41518b4af04d3cb8b2570b30c9135bffec2aa01f (patch) | |
tree | d864f109de46c994ffa7dd8abb21e0133ddec033 /Lib | |
parent | 80cbc9e99835f3ae72c62999b4852beab76a9017 (diff) | |
download | cpython-41518b4af04d3cb8b2570b30c9135bffec2aa01f.zip cpython-41518b4af04d3cb8b2570b30c9135bffec2aa01f.tar.gz cpython-41518b4af04d3cb8b2570b30c9135bffec2aa01f.tar.bz2 |
#17474 - Remove the various deprecated methods of Request class.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_urllib2.py | 21 | ||||
-rw-r--r-- | Lib/urllib/request.py | 44 |
2 files changed, 0 insertions, 65 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 4fc8c43..f16dc08 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -630,27 +630,6 @@ class OpenerDirectorTests(unittest.TestCase): self.assertTrue(args[1] is None or isinstance(args[1], MockResponse)) - def test_method_deprecations(self): - req = Request("http://www.example.com") - - with self.assertWarns(DeprecationWarning): - req.add_data("data") - with self.assertWarns(DeprecationWarning): - req.get_data() - with self.assertWarns(DeprecationWarning): - req.has_data() - with self.assertWarns(DeprecationWarning): - req.get_host() - with self.assertWarns(DeprecationWarning): - req.get_selector() - with self.assertWarns(DeprecationWarning): - req.is_unverifiable() - with self.assertWarns(DeprecationWarning): - req.get_origin_req_host() - with self.assertWarns(DeprecationWarning): - req.get_type() - - def sanepathname2url(path): try: path.encode("utf-8") diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 8035f7c..90731cb 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -321,50 +321,6 @@ class Request: else: return self.full_url - # Begin deprecated methods - - def add_data(self, data): - msg = "Request.add_data method is deprecated." - warnings.warn(msg, DeprecationWarning, stacklevel=1) - self.data = data - - def has_data(self): - msg = "Request.has_data method is deprecated." - warnings.warn(msg, DeprecationWarning, stacklevel=1) - return self.data is not None - - def get_data(self): - msg = "Request.get_data method is deprecated." - warnings.warn(msg, DeprecationWarning, stacklevel=1) - return self.data - - def get_type(self): - msg = "Request.get_type method is deprecated." - warnings.warn(msg, DeprecationWarning, stacklevel=1) - return self.type - - def get_host(self): - msg = "Request.get_host method is deprecated." - warnings.warn(msg, DeprecationWarning, stacklevel=1) - return self.host - - def get_selector(self): - msg = "Request.get_selector method is deprecated." - warnings.warn(msg, DeprecationWarning, stacklevel=1) - return self.selector - - def is_unverifiable(self): - msg = "Request.is_unverifiable method is deprecated." - warnings.warn(msg, DeprecationWarning, stacklevel=1) - return self.unverifiable - - def get_origin_req_host(self): - msg = "Request.get_origin_req_host method is deprecated." - warnings.warn(msg, DeprecationWarning, stacklevel=1) - return self.origin_req_host - - # End deprecated methods - def set_proxy(self, host, type): if self.type == 'https' and not self._tunnel_host: self._tunnel_host = self.host |