tests: Only pass DISPLAY if it exists in the env.

This commit is contained in:
Florian Bruhin 2016-01-20 08:51:15 +01:00
parent 037be96718
commit 10f3617b5e

View File

@ -244,7 +244,8 @@ class Process(QObject):
procenv = QProcessEnvironment()
for k, v in env.items():
procenv.insert(k, v)
procenv.insert('DISPLAY', os.environ['DISPLAY'])
if 'DISPLAY' in os.environ:
procenv.insert('DISPLAY', os.environ['DISPLAY'])
self.proc.readyRead.connect(self.read_log)
self.proc.setProcessEnvironment(procenv)