

import pydoc
import sys

import eris.termstr


class TermDoc(pydoc.TextDoc):

    def bold(self, text):
        return str(eris.termstr.TermStr(text).bold())


def main():
    path = sys.argv[1]
    print(pydoc.render_doc(pydoc.importfile(path), renderer=TermDoc()))


if __name__ == "__main__":
    main()



import pydoc
import sys

import eris.termstr


class TermDoc(pydoc.TextDoc):

    def bold(self, text):
        return str(eris.termstr.TermStr(text).bold())


def main():
    path = sys.argv[1]
    try:
        print(pydoc.render_doc(pydoc.importfile(path), renderer=TermDoc()))
    except pydoc.ErrorDuringImport as e:
        print(e)
        return 1


if __name__ == "__main__":
    main()

Make pydoc quieter on error.
tools: Make pydoc quieter on error.

  
  
  import pydoc
  import sys
  
  import eris.termstr
  
  
  class TermDoc(pydoc.TextDoc):
  
      def bold(self, text):
          return str(eris.termstr.TermStr(text).bold())
  
  
  def main():
      path = sys.argv[1]
+     try:
-     print(pydoc.render_doc(pydoc.importfile(path), renderer=TermDoc()))
+         print(pydoc.render_doc(pydoc.importfile(path), renderer=TermDoc()))
+     except pydoc.ErrorDuringImport as e:
+         print(e)
+         return 1
  
  
  if __name__ == "__main__":
      main()
  
Make pydoc quieter on error.
## Code Before:


import pydoc
import sys

import eris.termstr


class TermDoc(pydoc.TextDoc):

    def bold(self, text):
        return str(eris.termstr.TermStr(text).bold())


def main():
    path = sys.argv[1]
    print(pydoc.render_doc(pydoc.importfile(path), renderer=TermDoc()))


if __name__ == "__main__":
    main()

## Instruction:
Make pydoc quieter on error.
## Code After:


import pydoc
import sys

import eris.termstr


class TermDoc(pydoc.TextDoc):

    def bold(self, text):
        return str(eris.termstr.TermStr(text).bold())


def main():
    path = sys.argv[1]
    try:
        print(pydoc.render_doc(pydoc.importfile(path), renderer=TermDoc()))
    except pydoc.ErrorDuringImport as e:
        print(e)
        return 1


if __name__ == "__main__":
    main()
