Changed subprocess stdout from devnull to None

This commit is contained in:
Andrew Murray 2019-02-06 19:07:53 +11:00
parent 168e51751e
commit 54f6cc7ea2

View File

@ -139,13 +139,11 @@ def Ghostscript(tile, size, fp, scale=1):
# push data through Ghostscript
try:
with open(os.devnull, 'w+b') as devnull:
startupinfo = None
if sys.platform.startswith('win'):
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
subprocess.check_call(command, stdout=devnull,
startupinfo=startupinfo)
startupinfo = None
if sys.platform.startswith('win'):
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
subprocess.check_call(command, startupinfo=startupinfo)
im = Image.open(outfile)
im.load()
finally: