From 5f9396ba633f9aef728eab46660bdfc3b44ff43e Mon Sep 17 00:00:00 2001 From: Lammert Hellinga Date: Mon, 21 Oct 2013 14:54:01 +0200 Subject: [PATCH] Modified if statement to check if cookiejar is not None, because cookiejars support the iterator protocol. If you create a cookiejar and supply it to the constructor it will have no cookies to iterate and therefore cookiejar will be 0 and "if cookiejar:" will be False. --- simplemediawiki.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simplemediawiki.py b/simplemediawiki.py index c052b43..87ae80f 100644 --- a/simplemediawiki.py +++ b/simplemediawiki.py @@ -103,9 +103,9 @@ def __init__(self, api_url, cookie_file=None, cookiejar=None, self._api_url = api_url self._http_user = http_user self._http_password = http_password - if cookiejar: + if cookiejar != None: self._cj = cookiejar - elif cookie_file: + elif cookie_file != None: self._cj = cookielib.FileCookieJar(cookie_file) try: self._cj.load()