From 6aa588860d2ebd5118e69b2a23e3965f4bd93dc2 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Fri, 5 Apr 2013 06:36:05 +0200 Subject: [PATCH] Code cleanup --- dosagelib/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dosagelib/util.py b/dosagelib/util.py index 7a50be5d3..05dc1c67d 100644 --- a/dosagelib/util.py +++ b/dosagelib/util.py @@ -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)