diff options
author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2008-03-27 15:04:56 +0000 |
---|---|---|
committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2008-03-27 15:04:56 +0000 |
commit | e7287ee63682309f89cadf9aa75de8fa8c44414a (patch) | |
tree | cc455f8b0e88887038f43cf71dd0d4463c2d3d71 | |
parent | 28aca5cffe4375b6923f9ccb4e0842e2ab79e4ed (diff) | |
download | docutils-e7287ee63682309f89cadf9aa75de8fa8c44414a.tar.gz |
fixed & improved assertion; thanks to Hans Ulrich Niedermann
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5538 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r-- | docutils/core.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docutils/core.py b/docutils/core.py index f68f74cea..bf3b2a4f1 100644 --- a/docutils/core.py +++ b/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.""" |