Skip to content

Commit

Permalink
Use deepcopy in "merge_dicts_with_copy" method
Browse files Browse the repository at this point in the history
Avoid problems parsing multiple functions from the same YAML.
  • Loading branch information
srisco committed Jan 15, 2020
1 parent 99a8cb2 commit 1c9931c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import tempfile
import uuid
import sys
from copy import deepcopy
from zipfile import ZipFile
from io import BytesIO
from typing import Optional, Dict, List, Generator, Union, Any
Expand Down Expand Up @@ -118,7 +119,7 @@ def merge_dicts(dict1: Dict, dict2: Dict) -> Dict:
def merge_dicts_with_copy(dict1: Dict, dict2: Dict) -> Dict:
"""Merge 'dict1' and 'dict2' dicts into a new Dict.
'dict2' has precedence over 'dict1'."""
result = dict1.copy()
result = deepcopy(dict1)
for key, val in dict2.items():
if val is not None:
if isinstance(val, dict) and key in result:
Expand Down
2 changes: 1 addition & 1 deletion scar/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = '4.0.0'
__version__ = '4.0.1'

0 comments on commit 1c9931c

Please sign in to comment.