Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
erp5
Commits
c0979706
Commit
c0979706
authored
May 30, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b1539ad6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
38 deletions
+43
-38
product/ERP5Type/patches/pylint.py
product/ERP5Type/patches/pylint.py
+43
-38
No files found.
product/ERP5Type/patches/pylint.py
View file @
c0979706
...
...
@@ -200,51 +200,56 @@ Module_getattr = Module.getattr
def
_getattr
(
self
,
name
,
*
args
,
**
kw
):
print
'AAA getattr %s %s'
%
(
self
.
name
,
name
)
try
:
return
Module_getattr
(
self
,
name
,
*
args
,
**
kw
)
except
NotFoundError
,
e
:
if
self
.
name
.
startswith
(
'erp5.'
):
raise
real_module
=
__import__
(
self
.
name
,
fromlist
=
[
self
.
name
],
level
=
0
)
try
:
attr
=
getattr
(
real_module
,
name
)
except
AttributeError
:
raise
e
return
Module_getattr
(
self
,
name
,
*
args
,
**
kw
)
except
NotFoundError
,
e
:
if
self
.
name
.
startswith
(
'erp5.'
):
raise
# REQUEST object (or any object non acquisition-wrapped)
if
(
isinstance
(
attr
,
str
)
and
attr
==
'<Special Object Used to Force Acquisition>'
):
raise
e
real_module
=
__import__
(
self
.
name
,
fromlist
=
[
self
.
name
],
level
=
0
)
try
:
attr
=
getattr
(
real_module
,
name
)
except
AttributeError
:
raise
e
try
:
origin_module_name
=
attr
.
__module__
except
AttributeError
:
from
astroid
import
nodes
if
isinstance
(
attr
,
dict
):
ast
=
nodes
.
Dict
(
attr
)
elif
isinstance
(
attr
,
list
):
ast
=
nodes
.
List
(
attr
)
elif
isinstance
(
attr
,
tuple
):
ast
=
nodes
.
Tuple
(
attr
)
elif
isinstance
(
attr
,
set
):
ast
=
nodes
.
Set
(
attr
)
# REQUEST object (or any object non acquisition-wrapped)
if
(
isinstance
(
attr
,
str
)
and
attr
==
'<Special Object Used to Force Acquisition>'
):
raise
e
try
:
origin_module_name
=
attr
.
__module__
except
AttributeError
:
from
astroid
import
nodes
if
isinstance
(
attr
,
dict
):
ast
=
nodes
.
Dict
(
attr
)
elif
isinstance
(
attr
,
list
):
ast
=
nodes
.
List
(
attr
)
elif
isinstance
(
attr
,
tuple
):
ast
=
nodes
.
Tuple
(
attr
)
elif
isinstance
(
attr
,
set
):
ast
=
nodes
.
Set
(
attr
)
else
:
try
:
ast
=
nodes
.
Const
(
attr
)
except
Exception
:
raise
e
else
:
if
self
.
name
==
origin_module_name
:
raise
# ast_from_class() actually works for any attribute of a Module
try
:
ast
=
nodes
.
Const
(
attr
)
except
Exception
:
ast
=
MANAGER
.
ast_from_class
(
attr
)
except
AstroidBuilding
Exception
:
raise
e
else
:
if
self
.
name
==
origin_module_name
:
raise
# ast_from_class() actually works for any attribute of a Module
try
:
ast
=
MANAGER
.
ast_from_class
(
attr
)
except
AstroidBuildingException
:
raise
e
self
.
locals
[
name
]
=
[
ast
]
return
[
ast
]
self
.
locals
[
name
]
=
[
ast
]
print
'
\
t
-> ok %s'
%
(
ast
,)
return
[
ast
]
except
Exception
,
e
:
print
'
\
t
-> %s'
%
(
e
,)
raise
Module
.
getattr
=
_getattr
if
sys
.
version_info
<
(
2
,
8
):
...
...
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