Code cleanup
This commit is contained in:
parent
fabe872d1d
commit
6aa588860d
1 changed files with 3 additions and 3 deletions
|
@ -285,12 +285,12 @@ def urlopen(url, session, referrer=None, max_content_bytes=None,
|
||||||
# requests << 1.0
|
# requests << 1.0
|
||||||
kwargs["prefetch"] = not stream
|
kwargs["prefetch"] = not stream
|
||||||
kwargs["config"] = {"max_retries": MaxRetries}
|
kwargs["config"] = {"max_retries": MaxRetries}
|
||||||
if data:
|
if data is None:
|
||||||
|
func = session.get
|
||||||
|
else:
|
||||||
kwargs['data'] = data
|
kwargs['data'] = data
|
||||||
func = session.post
|
func = session.post
|
||||||
out.debug('Sending POST data %s' % data, level=3)
|
out.debug('Sending POST data %s' % data, level=3)
|
||||||
else:
|
|
||||||
func = session.get
|
|
||||||
try:
|
try:
|
||||||
req = func(url, **kwargs)
|
req = func(url, **kwargs)
|
||||||
out.debug('Response cookies: %s' % req.cookies)
|
out.debug('Response cookies: %s' % req.cookies)
|
||||||
|
|
Loading…
Reference in a new issue