genre-change / demos /LogSuppressor.py
JonnyRysler's picture
Push demo files
1e254ea
raw
history blame
396 Bytes
import subprocess as sp
class LogSuppressor:
def __init__(self):
pass
@staticmethod
def suppress_subprocess_logging():
original_call = sp.call
def _call_nostderr(*args, **kwargs):
kwargs['stderr'] = sp.DEVNULL
kwargs['stdout'] = sp.DEVNULL
return original_call(*args, **kwargs)
sp.call = _call_nostderr