From 7b39b0fda042c3ab3a892820a08187bdfb25fdf9 Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Tue, 10 Aug 2021 15:55:14 +0300 Subject: [PATCH] plug.py: use copy.deepcopy() instead of dict() in cqc_callback To create deepcopy for passing data to cqc_callback --- plug.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plug.py b/plug.py index 334ca00d..02bd89d3 100644 --- a/plug.py +++ b/plug.py @@ -1,6 +1,7 @@ """ Plugin hooks for EDMC - Ian Norton, Jonathan Harris """ +import copy import importlib import logging import operator @@ -328,7 +329,7 @@ def notify_journal_entry_cqc(cmdr, is_beta, entry, state): if cqc_callback is not None and callable(cqc_callback): try: # Pass a copy of the journal entry in case the callee modifies it - newerror = cqc_callback(cmdr, is_beta, dict(entry), dict(state)) + newerror = cqc_callback(cmdr, is_beta, copy.deepcopy(entry), copy.deepcopy(state)) error = error or newerror except Exception: