Commit 3bdde386 authored by Sebastien Robin's avatar Sebastien Robin

[erp5_core]: DiffTool, do not break projects not having yet deepdiff and unidiff installed

parent 3b5c38b3
......@@ -27,10 +27,20 @@
#
##############################################################################
import deepdiff
import difflib
from deepdiff import DeepDiff
from unidiff import PatchSet
import warnings
try:
import deepdiff
except ImportError:
deepdiff = None
warnings.warn("Please install deepdiff, it is needed by Diff Tool",
DeprecationWarning)
try:
from unidiff import PatchSet
except ImportError:
PatchSet = None
warnings.warn("Please install unidiff, it is needed by Diff Tool",
DeprecationWarning)
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
from Products.ERP5Type.Globals import InitializeClass
......@@ -124,7 +134,7 @@ class PortalPatch:
new_value_dict = self.removePropertyList(self.new_value, export=True)
# Get the DeepDiff in tree format.
tree_diff = DeepDiff(old_value_dict,
tree_diff = deepdiff.DeepDiff(old_value_dict,
new_value_dict,
view='tree')
diff_tree_list = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment