Use copy.copy() instead of the copy() method, which might not exist

This commit is contained in:
Emmanuel BENOîT 2022-09-18 11:51:06 +02:00
parent 14ea834823
commit 91a90def13

View file

@ -1,4 +1,5 @@
import abc
import copy
from collections.abc import MutableMapping
from ansible import constants as C
@ -145,7 +146,7 @@ class VariableStorage(MutableMapping):
data = {}
for v in variables:
if v in self._script_vars:
se = (True, self._script_vars[v].copy())
se = (True, copy.copy(self._script_vars[v]))
else:
se = (False, None)
data[v] = se