Revision: 4380 Author: btongminh Date: 2007-09-29 10:41:53 +0000 (Sat, 29 Sep 2007)
Log Message: ----------- Site.UrlEncode now accepts all iterable.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-09-29 10:33:52 UTC (rev 4379) +++ trunk/pywikipedia/wikipedia.py 2007-09-29 10:41:53 UTC (rev 4380) @@ -3243,8 +3243,12 @@ a http POST request""" if not query: return None + if hasattr('iteritems', query): + iterator = query.iteritems() + else: + iterator = iter(query) l = [] - for key, value in query.iteritems(): + for key, value in iterator: if isinstance(key, unicode): key = key.encode('utf-8') if isinstance(value, unicode):