Skip to content

Commit

Permalink
Merge pull request scrapy#4682 from noviluni/remove_python2_reminiscence
Browse files Browse the repository at this point in the history
remove python 2 reminiscence in cookies
  • Loading branch information
kmike authored Jul 16, 2020
2 parents b97a39f + 0e0d1ad commit 9a74a71
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions scrapy/http/cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@ def __init__(self, response):
def info(self):
return self

# python3 cookiejars calls get_all
def get_all(self, name, default=None):
return [to_unicode(v, errors='replace')
for v in self.response.headers.getlist(name)]
# python2 cookiejars calls getheaders
getheaders = get_all
3 changes: 0 additions & 3 deletions tests/test_http_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ def setUp(self):
def test_info(self):
self.assertIs(self.wrapped.info(), self.wrapped)

def test_getheaders(self):
self.assertEqual(self.wrapped.getheaders('content-type'), ['text/html'])

def test_get_all(self):
# get_all result must be native string
self.assertEqual(self.wrapped.get_all('content-type'), ['text/html'])

0 comments on commit 9a74a71

Please sign in to comment.