Revision: 8220 Author: nicdumz Date: 2010-05-26 10:28:57 +0000 (Wed, 26 May 2010)
Log Message: ----------- add a defensive assert.
if source is not a Site, errors can be rather unclear to inadvertent API users.
Modified Paths: -------------- branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py =================================================================== --- branches/rewrite/pywikibot/page.py 2010-05-26 10:17:53 UTC (rev 8219) +++ branches/rewrite/pywikibot/page.py 2010-05-26 10:28:57 UTC (rev 8220) @@ -2067,6 +2067,9 @@ @type defaultNamespace: int
""" + assert source is None or isinstance(source, pywikibot.site.BaseSite), \ + "source parameter should be a Site object" + self._text = text self._source = source or pywikibot.Site() self._defaultns = defaultNamespace
pywikipedia-svn@lists.wikimedia.org