From f7a88da5c8a7d3e936a6802a7c09ddde351fd320 Mon Sep 17 00:00:00 2001 From: goodger Date: Thu, 27 Mar 2008 15:04:56 +0000 Subject: [PATCH] fixed & improved assertion; thanks to Hans Ulrich Niedermann git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk@5538 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/docutils/core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docutils/docutils/core.py b/docutils/docutils/core.py index f68f74cea..bf3b2a4f1 100644 --- a/docutils/docutils/core.py +++ b/docutils/docutils/core.py @@ -53,9 +53,11 @@ class Publisher: """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.""" -- 2.11.4.GIT