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
c9371699
Commit
c9371699
authored
Mar 31, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Type/component_package,dynamic: implement PEP-0451
for pylint 3 to understand erp5 dynamic modules
parent
66f6fead
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
product/ERP5Type/dynamic/component_package.py
product/ERP5Type/dynamic/component_package.py
+9
-0
product/ERP5Type/dynamic/dynamic_module.py
product/ERP5Type/dynamic/dynamic_module.py
+11
-0
No files found.
product/ERP5Type/dynamic/component_package.py
View file @
c9371699
...
...
@@ -222,6 +222,15 @@ class ComponentDynamicPackage(ModuleType):
if
import_lock_held
:
imp
.
acquire_lock
()
def
find_spec
(
self
,
name
,
path
=
None
,
target
=
None
):
"""PEP-0451
"""
assert
six
.
PY3
if
self
.
find_module
(
name
,
path
)
is
None
:
return
None
import
importlib.util
return
importlib
.
util
.
spec_from_loader
(
name
,
self
)
def
_getVersionPackage
(
self
,
version
):
"""
Get the version package (NAMESPACE.VERSION_version) for the given version
...
...
product/ERP5Type/dynamic/dynamic_module.py
View file @
c9371699
...
...
@@ -41,6 +41,17 @@ class PackageType(ModuleType):
"""
__path__
=
[]
def
__init__
(
self
,
name
,
doc
=
None
):
super
(
PackageType
,
self
).
__init__
(
name
=
name
,
doc
=
doc
)
if
six
.
PY3
:
# PEP-0451
import
importlib.machinery
self
.
__spec__
=
importlib
.
machinery
.
ModuleSpec
(
name
=
self
.
__name__
,
loader
=
None
,
)
class
RefManager
(
dict
):
"""
self[ComponentTool.last_sync] = (HTTP_REQUEST_WEAKSET,
...
...
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