From 99d4784d3e71b3d1e17e3ba4ae9e7e3c48b5fecd Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 8 Nov 2020 14:53:15 -0500 Subject: [PATCH] Fix attribute error in JSON testsuite --- src/test/run-make-fulldeps/rustdoc-json/compare.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/run-make-fulldeps/rustdoc-json/compare.py b/src/test/run-make-fulldeps/rustdoc-json/compare.py index 85aa064aa6722..5daf8903e2030 100644 --- a/src/test/run-make-fulldeps/rustdoc-json/compare.py +++ b/src/test/run-make-fulldeps/rustdoc-json/compare.py @@ -6,6 +6,7 @@ # `index` or `paths` mappings. To add a new test run `rustdoc --output-format json -o . yourtest.rs` # and then create `yourtest.expected` by stripping unnecessary details from `yourtest.json`. +import copy import sys import json import types @@ -43,7 +44,7 @@ def _check_subset(expected, actual, trace): for key in expected: if key not in actual: raise SubsetException("Key `{}` not found in output".format(key), trace) - new_trace = trace.copy() + new_trace = copy.deepcopy(trace) new_trace.append(key) _check_subset(expected[key], actual[key], new_trace) elif expected_type is list: @@ -54,7 +55,7 @@ def _check_subset(expected, actual, trace): "Found {} items, expected {}".format(expected_elements, actual_elements), trace ) for expected, actual in zip(expected, actual): - new_trace = trace.copy() + new_trace = copy.deepcopy(trace) new_trace.append(expected) _check_subset(expected, actual, new_trace) elif expected_type is ID and expected not in already_checked: