Merge "Use deepcopy for dict copy operations"

This commit is contained in:
Zuul 2018-02-14 12:49:59 +00:00 committed by Gerrit Code Review
commit 5849ccd2e1
1 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@
# limitations under the License.
import calendar
import copy
import datetime
from itertools import chain
import json
@ -37,9 +38,9 @@ class PTGDataBase():
with open(self.filename, 'r') as fp:
self.data = json.load(fp)
else:
self.data = self.BASE
self.data = copy.deepcopy(self.BASE)
old_data = self.data['additional'].copy()
old_data = copy.deepcopy(self.data['additional'])
self.load_data_from_config()
self.merge_additional(old_data)
self.save()
@ -167,7 +168,7 @@ class PTGDataBase():
self.save()
def wipe(self):
self.data = self.BASE
self.data = copy.deepcopy(self.BASE)
self.save()
def save(self):