Code cleanup

This commit is contained in:
Bastian Kleineidam 2013-04-05 06:36:05 +02:00
parent fabe872d1d
commit 6aa588860d

View file

@ -285,12 +285,12 @@ def urlopen(url, session, referrer=None, max_content_bytes=None,
# requests << 1.0
kwargs["prefetch"] = not stream
kwargs["config"] = {"max_retries": MaxRetries}
if data:
if data is None:
func = session.get
else:
kwargs['data'] = data
func = session.post
out.debug('Sending POST data %s' % data, level=3)
else:
func = session.get
try:
req = func(url, **kwargs)
out.debug('Response cookies: %s' % req.cookies)