Handle errors

This commit is contained in:
Niles Rogoff 2017-02-10 18:45:17 -05:00
parent b1b065d5c3
commit 107844d519
No known key found for this signature in database
GPG Key ID: B78B908F23430F80
1 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,11 @@ else:
noise_level = ["-m", "noise_scale", "--noise_level", str(noise_level)]
args = ["waifu2x-converter-cpp", "-j", "2", *noise_level, "-o", outfile, "-i", infile]
print(" ".join(args))
subprocess.call(args, stdout=null)
try:
subprocess.check_call(args, stdout=null)
except:
print("Failed. Check your waifu2x installation")
null.close()
sys.exit(1)
null.close()
print("Written to " + outfile)