@contextmanager
def nostderr():
 savestderr = sys.stderr
 class Devnull(object, ):
  ' /dev/null incarnation as output-stream-like object '
  def write(self, _):
   ' Write method - just does nothing'
   pass
 sys.stderr = Devnull()
 try:
  (yield)
 finally:
  sys.stderr = savestderr

@ contextmanager def nostderr ( ) : savestderr = sys . stderr class Devnull ( object , ) : def write ( self , _ ) : pass sys . stderr = Devnull ( ) try : ( yield ) finally : sys . stderr = savestderr
contextmanager to suppress stderr messages URL .