diff options
| -rw-r--r-- | Lib/cmd.py | 3 | ||||
| -rw-r--r-- | Misc/NEWS.d/next/Library/2023-10-17-16-11-03.gh-issue-52161.WBYyCJ.rst | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -42,7 +42,7 @@ listings of documented functions, miscellaneous topics, and undocumented functions respectively. """ -import string, sys +import inspect, string, sys __all__ = ["Cmd"] @@ -305,6 +305,7 @@ class Cmd: except AttributeError: try: doc=getattr(self, 'do_' + arg).__doc__ + doc = inspect.cleandoc(doc) if doc: self.stdout.write("%s\n"%str(doc)) return diff --git a/Misc/NEWS.d/next/Library/2023-10-17-16-11-03.gh-issue-52161.WBYyCJ.rst b/Misc/NEWS.d/next/Library/2023-10-17-16-11-03.gh-issue-52161.WBYyCJ.rst new file mode 100644 index 0000000..3f598d4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-10-17-16-11-03.gh-issue-52161.WBYyCJ.rst @@ -0,0 +1,2 @@ +:meth:`cmd.Cmd.do_help` now cleans docstrings with :func:`inspect.cleandoc`
+before writing them. Patch by Filip Łapkiewicz. |
