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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
3282936d
Commit
3282936d
authored
May 13, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: import from collections.abc on python3
parent
839794c5
Changes
2
Show 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 @
3282936d
...
...
@@ -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 @
3282936d
...
...
@@ -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