2017-07-24 13:00:37 +02:00
|
|
|
import jwutils
|
2017-07-24 12:19:34 +02:00
|
|
|
|
|
|
|
|
print "This is without muted output"
|
|
|
|
|
|
2017-07-24 13:00:37 +02:00
|
|
|
with jwutils.MuteStdIO():
|
2017-07-24 12:19:34 +02:00
|
|
|
print "This is with muted output"
|
|
|
|
|
|
2017-07-24 13:00:37 +02:00
|
|
|
with jwutils.MuteStdIO():
|
2017-07-24 12:19:34 +02:00
|
|
|
print "This will have an error"
|
|
|
|
|
print "Second suppressed line of output"
|
|
|
|
|
print "Third suppressed line of output"
|
|
|
|
|
raise Exception("Something went wrong")
|
|
|
|
|
|
|
|
|
|
print "Output is unmuted again"
|