Skip to content

Commit

Permalink
py2 inspection suppression/comments
Browse files Browse the repository at this point in the history
  • Loading branch information
secynic committed Jul 20, 2016
1 parent 0c1ba4f commit a67ddaf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ipwhois/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,7 @@ def get_http_raw(self, url=None, retry_count=3, headers=None,
if form_data:
form_data = urlencode(form_data)
try:
# Py 2 inspection will alert on the encoding arg, no harm done.
form_data = bytes(form_data, encoding='ascii')
except TypeError: # pragma: no cover
pass
Expand All @@ -893,8 +894,9 @@ def get_http_raw(self, url=None, retry_count=3, headers=None,
log.debug('HTTP query for {0} at {1}'.format(
self.address_str, url))
try:
# Py 2 inspection alert bypassed by using kwargs dict.
conn = Request(url=url, data=form_data, headers=headers,
method=request_type)
**{'method': request_type})
except TypeError: # pragma: no cover
conn = Request(url=url, data=form_data, headers=headers)
data = self.opener.open(conn, timeout=self.timeout)
Expand Down

0 comments on commit a67ddaf

Please sign in to comment.