Changes between Initial Version and Version 1 of Ticket #13


Ignore:
Timestamp:
04/10/20 14:53:23 (6 years ago)
Author:
zhangjr
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13 – Description

    initial v1  
    11When importing mantid and sqlalchemy modules, some warning show. In most cases, we can do nothing about it.
     2
     3
     4from contextlib import contextmanager
     5@contextmanager
     6def quiet():
     7    sys.stdout = sys.stderr = open(os.devnull, "w")
     8    try:
     9        yield
     10    finally:
     11        sys.stdout = sys.__stdout__
     12        sys.stderr = sys.__stderr__