Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
101
Merge Requests
101
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
917296b4
Commit
917296b4
authored
Sep 25, 2024
by
Arnaud Fontaine
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pylint 1.4: Understands six.{PY2,PY3} import guards (already supported on pylint 2).
parent
66c1fc8c
Pipeline
#37027
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
component/pylint/buildout.cfg
component/pylint/buildout.cfg
+1
-0
component/pylint/understands-six.PY2-six.PY3-import-guard.patch
...ent/pylint/understands-six.PY2-six.PY3-import-guard.patch
+19
-0
No files found.
component/pylint/buildout.cfg
View file @
917296b4
...
@@ -14,6 +14,7 @@ recipe = zc.recipe.egg:custom
...
@@ -14,6 +14,7 @@ recipe = zc.recipe.egg:custom
patches =
patches =
${:_profile_base_location_}/pylint-super_on_old_class.patch#cb0c3f8c091bf4980be395c917edc435
${:_profile_base_location_}/pylint-super_on_old_class.patch#cb0c3f8c091bf4980be395c917edc435
${:_profile_base_location_}/pylint-redefining-builtins-modules.patch#043defc6e9002ac48b40e078797d4d17
${:_profile_base_location_}/pylint-redefining-builtins-modules.patch#043defc6e9002ac48b40e078797d4d17
${:_profile_base_location_}/understands-six.PY2-six.PY3-import-guard.patch#39f8ef6c16648dc41685a94399fd2cdb
patch-options = -p1
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
patch-binary = ${patch:location}/bin/patch
...
...
component/pylint/understands-six.PY2-six.PY3-import-guard.patch
0 → 100644
View file @
917296b4
Author: Arnaud Fontaine <arnaud.fontaine@nexedi.com>
Date: Wed Apr 3 14:58:52 2024 +0900
Fixes #3501 (pylint.git:e5e6ca71) for pylint 1.4.
--- a/pylint/checkers/variables.py 2024-06-26 16:40:48.654379000 +0000
+++ b/pylint/checkers/variables.py 2024-09-25 10:31:09.680816539 +0000
@@ -987,7 +987,10 @@
if module is astroid.YES:
return None
except astroid.NotFoundError:
- if module.name in ignored_modules:
+ if (module.name in ignored_modules or
+ (node.parent is not None and
+ isinstance(node.parent, astroid.nodes.If) and
+ node.parent.test.as_string() in ('six.PY2', 'six.PY3'))):
return None
self.add_message('no-name-in-module',
args=(name, module.name), node=node)
Jérome Perrin
@jerome
mentioned in commit
81985a28
·
Sep 26, 2024
mentioned in commit
81985a28
mentioned in commit 81985a287caa71377c372c85d11728f984cb47f7
Toggle commit list
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