Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
9d91d565
Commit
9d91d565
authored
May 13, 2024
by
Jérome Perrin
Committed by
Arnaud Fontaine
Jul 04, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: import from collections.abc on python3
parent
dd4bc0f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SessionTool.py
...ntTemplateItem/portal_components/tool.erp5.SessionTool.py
+11
-5
product/ERP5Type/patches/diff.py
product/ERP5Type/patches/diff.py
+6
-2
No files found.
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SessionTool.py
View file @
9d91d565
...
...
@@ -34,8 +34,14 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
from
Products.ERP5Type
import
Permissions
from
Acquisition
import
aq_base
from
six.moves
import
UserDict
import
collections
import
six
# pylint:disable=import-error,no-name-in-module
if
six
.
PY3
:
import
collections.abc
as
collections_abc
else
:
import
collections
as
collections_abc
# pylint:enable=import-error,no-name-in-module
# the ERP5 cache factory used as a storage
SESSION_CACHE_FACTORY
=
'erp5_session_cache'
...
...
@@ -54,11 +60,11 @@ def remove_acquisition_wrapper(obj):
if
isinstance
(
obj
,
basestring
):
return
obj
obj
=
aq_base
(
obj
)
if
isinstance
(
obj
,
collections
.
Mapping
):
if
isinstance
(
obj
,
collections
_abc
.
Mapping
):
return
obj
.
__class__
({
remove_acquisition_wrapper
(
k
):
remove_acquisition_wrapper
(
v
)
for
k
,
v
in
obj
.
items
()})
if
isinstance
(
obj
,
(
collections
.
Sequence
,
collections
.
Set
)):
if
isinstance
(
obj
,
(
collections
_abc
.
Sequence
,
collections_abc
.
Set
)):
return
obj
.
__class__
([
remove_acquisition_wrapper
(
o
)
for
o
in
obj
])
return
obj
...
...
@@ -68,11 +74,11 @@ def restore_acquisition_wrapper(obj, context):
return
obj
if
hasattr
(
obj
,
'__of__'
):
obj
=
obj
.
__of__
(
context
)
if
isinstance
(
obj
,
collections
.
Mapping
):
if
isinstance
(
obj
,
collections
_abc
.
Mapping
):
return
obj
.
__class__
({
restore_acquisition_wrapper
(
k
,
context
):
restore_acquisition_wrapper
(
v
,
context
)
for
k
,
v
in
obj
.
items
()})
if
isinstance
(
obj
,
(
collections
.
Sequence
,
collections
.
Set
)):
if
isinstance
(
obj
,
(
collections
_abc
.
Sequence
,
collections_abc
.
Set
)):
return
obj
.
__class__
([
restore_acquisition_wrapper
(
o
,
context
)
for
o
in
obj
])
return
obj
...
...
product/ERP5Type/patches/diff.py
View file @
9d91d565
...
...
@@ -27,8 +27,12 @@
##############################################################################
import
warnings
from
collections
import
Mapping
from
collections
import
Iterable
import
six
if
six
.
PY3
:
from
collections.abc
import
Iterable
,
Mapping
else
:
from
collections
import
Iterable
,
Mapping
try
:
from
deepdiff
import
DeepDiff
from
deepdiff.helper
import
strings
,
numbers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment