Revision: 7651 Author: alexsh Date: 2009-11-15 14:40:06 +0000 (Sun, 15 Nov 2009)
Log Message: ----------- fix NoneType Error when using non-cross-project family
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2009-11-15 13:17:01 UTC (rev 7650) +++ trunk/pywikipedia/wikipedia.py 2009-11-15 14:40:06 UTC (rev 7651) @@ -5244,9 +5244,12 @@
if os.path.exists(localPa): #read and dump local logindata into self._cookies[index] - for k, v in self._readCookies(localFn).iteritems(): - if k and v and k not in self._cookies[index]: - self._cookies[index][k] = v + if type(self._cookies[index]) == dict: + for k, v in self._readCookies(localFn).iteritems(): + if k not in self._cookies[index]: + self._cookies[index][k] = v + else: + self._cookies[index] = dict([(k,v) for k,v in self._readCookies(localFn).iteritems()]) #self._cookies[index] = query.CombineParams(self._cookies[index], self._readCookies(localFn)) elif not os.path.exists(localPa) and not self.family.cross_projects: #keep anonymous mode if not login and centralauth not enable