From: <go...@us...> - 2008-03-27 15:05:16
|
Author: goodger Date: 2008-03-27 16:04:56 +0100 (Thu, 27 Mar 2008) New Revision: 5538 Modified: trunk/docutils/docutils/core.py Log: fixed & improved assertion; thanks to Hans Ulrich Niedermann Modified: trunk/docutils/docutils/core.py =================================================================== --- trunk/docutils/docutils/core.py 2008-03-20 22:15:27 UTC (rev 5537) +++ trunk/docutils/docutils/core.py 2008-03-27 15:04:56 UTC (rev 5538) @@ -53,9 +53,11 @@ """A `docutils.writers.Writer` instance.""" for component in 'reader', 'parser', 'writer': - assert not isinstance(getattr(self, component), StringType), \ - ('passed string as "%s" parameter; use "%s_name" instead' - % (getattr(self, component), component, component)) + assert not isinstance(getattr(self, component), StringType), ( + 'passed string "%s" as "%s" parameter; pass an instance, ' + 'or use the "%s_name" parameter instead (in ' + 'docutils.core.publish_* convenience functions).' + % (getattr(self, component), component, component)) self.source = source """The source of input data, a `docutils.io.Input` instance.""" |