From 4fabebf7ce7d2217afb1fdfc2ab76499ef0448a4 Mon Sep 17 00:00:00 2001 From: germann_e Date: Wed, 23 Aug 2023 13:46:17 +0200 Subject: [PATCH] FIX: no deep copy for list_no_state lists --- pmodules_tools/db_diff/check.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pmodules_tools/db_diff/check.py b/pmodules_tools/db_diff/check.py index 94125c2a..896ca83e 100644 --- a/pmodules_tools/db_diff/check.py +++ b/pmodules_tools/db_diff/check.py @@ -102,9 +102,13 @@ def db_check_diff(current_pmodule_state, Pmodules_db_path, Pmodules_states): ) old_db = set(" ".join(i.split()) for i in old_pmodule_state.splitlines()) all_module_list = list(current_db) - all_module_list_sorted = sorted([x for x in all_module_list if 'stable' in x]) - all_module_list_sorted += sorted([x for x in all_module_list if 'unstable' in x]) - all_module_list_sorted += sorted([x for x in all_module_list if 'deprecated' in x]) + all_module_list_sorted = sorted([x for x in all_module_list if "stable" in x]) + all_module_list_sorted += sorted( + [x for x in all_module_list if "unstable" in x] + ) + all_module_list_sorted += sorted( + [x for x in all_module_list if "deprecated" in x] + ) all_module_list = all_module_list_sorted # We have to check the differences between the pmodule states. @@ -151,14 +155,14 @@ def print_pmodules_differences( changed_module_list = [] # Replace the state of the modules with * for Regex comparison - new_module_list_no_state = new_module_list.copy() - deleted_module_list_no_state = deleted_module_list.copy() + new_module_list_no_state = [] + deleted_module_list_no_state = [] for state in Pmodules_states: new_module_list_no_state = [ - diff.replace(state, ".*") for diff in new_module_list_no_state + diff.replace(state, ".*") for diff in new_module_list ] deleted_module_list_no_state = [ - diff.replace(state, ".*") for diff in deleted_module_list_no_state + diff.replace(state, ".*") for diff in deleted_module_list ] # Check if the state of the module is the only thing that changed