code: def cmdexc(self, argv):
          
          import sys
          type, exc, traceback = sys.exc_info()
          if isinstance(exc, CmdlnUserError):
              msg = "%s %s: %s\nTry '%s help %s' for info.\n"\
                    % (self.name, argv[0], exc, self.name, argv[0])
              self.stderr.write(self._str(msg))
              self.stderr.flush()
              return True
docs: Called if an exception is raised in any of precmd(), onecmd(),
          or postcmd(). If True is returned, the exception is deemed to have
          been dealt with. Otherwise, the exception is re-raised.
  
          The default implementation handles CmdlnUserError's, which
          typically correspond to user error in calling commands (as
          opposed to programmer error in the design of the script using
          cmdln.py).