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
b27d23e3
Commit
b27d23e3
authored
Apr 24, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patches/pylint: update register_xpkg for python3
parent
7dd644ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
product/ERP5Type/patches/pylint.py
product/ERP5Type/patches/pylint.py
+14
-6
No files found.
product/ERP5Type/patches/pylint.py
View file @
b27d23e3
...
@@ -524,12 +524,20 @@ def register_xpkg(pkgname):
...
@@ -524,12 +524,20 @@ def register_xpkg(pkgname):
except ImportError:
except ImportError:
pass
pass
else:
else:
def xpkg_transform(node):
if six.PY2:
m = AstroidBuilder(MANAGER).string_build('
__path__
=
%
r' % pkg.__path__)
def xpkg_transform(node):
m.package = True
m = AstroidBuilder(MANAGER).string_build('
__path__
=
%
r' % pkg.__path__)
m.name = pkgname
m.package = True
return m
m.name = pkgname
MANAGER.register_transform(Module, xpkg_transform, lambda node: node.name == pkgname)
return m
MANAGER.register_transform(Module, xpkg_transform, lambda node: node.name == pkgname)
else:
import importlib
def fail_hook_xpkg(modname):
if modname.split('
.
')[0] == pkgname:
return MANAGER.ast_from_module(importlib.import_module(modname))
raise AstroidBuildingError()
MANAGER.register_failed_import_hook(fail_hook_xpkg)
register_xpkg('
wendelin
')
register_xpkg('
wendelin
')
register_xpkg('
xlte
')
register_xpkg('
xlte
')
...
...
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