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
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
amrani
erp5
Commits
4996fe4d
Commit
4996fe4d
authored
Nov 26, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support pylint 1.4.0 with keeping backward compatibility with older versions.
parent
2612abfe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
product/ERP5Type/patches/pylint.py
product/ERP5Type/patches/pylint.py
+9
-1
No files found.
product/ERP5Type/patches/pylint.py
View file @
4996fe4d
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
inspect
import
getargspec
try
:
try
:
from
pylint.checkers
import
imports
from
pylint.checkers
import
imports
...
@@ -26,7 +27,7 @@ try:
...
@@ -26,7 +27,7 @@ try:
except
ImportError
:
except
ImportError
:
pass
pass
else
:
else
:
def
get_imported_module
(
self
,
modnode
,
importnode
,
modname
):
def
_get_imported_module
(
self
,
importnode
,
modname
):
try
:
try
:
return
importnode
.
do_import_module
(
modname
)
return
importnode
.
do_import_module
(
modname
)
except
astroid
.
InferenceError
,
ex
:
except
astroid
.
InferenceError
,
ex
:
...
@@ -63,4 +64,11 @@ else:
...
@@ -63,4 +64,11 @@ else:
args
=
repr
(
modname
)
args
=
repr
(
modname
)
self
.
add_message
(
"F0401"
,
args
=
args
,
node
=
importnode
)
self
.
add_message
(
"F0401"
,
args
=
args
,
node
=
importnode
)
if
'modnode'
in
getargspec
(
imports
.
ImportsChecker
.
get_imported_module
).
args
:
# BBB for pylint < 1.4.0
def
get_imported_module
(
self
,
modnode
,
importnode
,
modname
):
return
_get_imported_module
(
self
,
importnode
,
modname
)
else
:
get_imported_module
=
_get_imported_module
imports
.
ImportsChecker
.
get_imported_module
=
get_imported_module
imports
.
ImportsChecker
.
get_imported_module
=
get_imported_module
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