SF.net SVN: docutils:[9721] trunk/docutils/docutils/nodes.py

milde--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9721
          http://sourceforge.net/p/docutils/code/9721
Author:   milde
Date:     2024-05-31 14:41:57 +0000 (Fri, 31 May 2024)
Log Message:
-----------
Use `str()` to get the message from Exception instance.

Modified Paths:
--------------
    trunk/docutils/docutils/nodes.py

Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py	2024-05-28 07:26:08 UTC (rev 9720)
+++ trunk/docutils/docutils/nodes.py	2024-05-31 14:41:57 UTC (rev 9721)
@@ -1136,8 +1136,7 @@
                 self.attributes[key] = ATTRIBUTE_VALIDATORS[key](value)
             except (ValueError, TypeError, KeyError) as e:
                 messages.append(
-                    f'Attribute "{key}" has invalid value "{value}".\n'
-                    + e.args[0])  # message argument
+                    f'Attribute "{key}" has invalid value "{value}".\n{e}')
         if messages:
             raise ValueError('\n'.join(messages))
 
@@ -1152,7 +1151,7 @@
         try:
             self.validate_attributes()
         except ValueError as e:
-            messages.append(e.args[0])  # the message argument
+            messages.append(str(e))
         # test number of children
         n_min, n_max = self.valid_len
         if len(self.children) < n_min:

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.