class NoOutputStream(OutputStream):

    def write(self, b, off, len):
        pass
System.setOut(PrintStream(NoOutputStream()))
System.out.println('foo')
System.setOut(oldOut)
System.out.println('foo')
Управление stdout/stderr из Jython