Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Lib/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
functions respectively.
"""

import inspect, string, sys
import string, sys

__all__ = ["Cmd"]

Expand Down Expand Up @@ -303,9 +303,11 @@ def do_help(self, arg):
try:
func = getattr(self, 'help_' + arg)
except AttributeError:
from inspect import cleandoc

try:
doc=getattr(self, 'do_' + arg).__doc__
doc = inspect.cleandoc(doc)
doc = cleandoc(doc)
if doc:
self.stdout.write("%s\n"%str(doc))
return
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Improve import time of :mod:`cmd` by lazy importing :mod:`inspect`. Patch by
Semyon Moroz.
Loading