1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 00:39:46 +00:00

sshcontrol: Use os.environ.copy() instead of copy.copy()

os.environ is special and copy.copy() doesn't do what we'd expect,
changes in the child object change the parent. copy.deepcopy() is
also known to have issues with it.

Use the dedicated .copy() method which will not influence the
parent. This fixes selftest failures where the DISPLAY variable
disappears.

(From OE-Core rev: 638cd44cc9a9eb435350aac7e8eeec585d74f8db)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2015-07-29 10:50:49 +01:00
parent e384d9ba0c
commit 54c92196b8
+1 -2
View File
@@ -10,7 +10,6 @@ import subprocess
import time import time
import os import os
import select import select
import copy
class SSHProcess(object): class SSHProcess(object):
@@ -33,7 +32,7 @@ class SSHProcess(object):
self.logfile = None self.logfile = None
# Unset DISPLAY which means we won't trigger SSH_ASKPASS # Unset DISPLAY which means we won't trigger SSH_ASKPASS
env = copy.copy(os.environ) env = os.environ.copy()
if "DISPLAY" in env: if "DISPLAY" in env:
del env['DISPLAY'] del env['DISPLAY']
self.options['env'] = env self.options['env'] = env