Only copy the environment to the mplayer executable if it's set, and don't copy the whole environment from platypush

This commit is contained in:
Fabio Manganiello 2019-02-02 17:32:56 +01:00
parent c18650c964
commit 9ebb265458

View file

@ -112,13 +112,15 @@ class MediaMplayerPlugin(MediaPlugin):
if arg not in args:
args.append(arg)
env = os.environ.copy()
if self._env:
env.update(self._env)
popen_args = {
'stdin': subprocess.PIPE,
'stdout': subprocess.PIPE,
}
self._mplayer = subprocess.Popen(args, env=env,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
if self._env:
popen_args['env'] = self._env
self._mplayer = subprocess.Popen(args, **popen_args)
def _build_actions(self):
""" Populates the actions list by introspecting the mplayer executable """