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
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
Lukas Niegsch
slapos
Commits
0663f9d3
Commit
0663f9d3
authored
May 09, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
component/pylint: backport an astroid patch for redundant-keyword-arg false positive
parent
b336f593
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
1 deletion
+53
-1
component/pylint/astroid-functools.wraps-needs-to-be-called-with-the-decorate.patch
...unctools.wraps-needs-to-be-called-with-the-decorate.patch
+51
-0
component/pylint/buildout.cfg
component/pylint/buildout.cfg
+1
-0
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+1
-1
No files found.
component/pylint/astroid-functools.wraps-needs-to-be-called-with-the-decorate.patch
0 → 100644
View file @
0663f9d3
From c13857606dda6be0d48a3f40d7466391b5ab951b Mon Sep 17 00:00:00 2001
From: Claudiu Popa <pcmanticore@gmail.com>
Date: Wed, 26 Aug 2015 20:51:18 +0300
Subject: [PATCH] functools.wraps needs to be called with the decorated
function and the implementation of cached decorator was passing the bad
arguments (grafted from 2a66d7f8cf83616b3eac63bcae61efe655678ab7)
--HG--
branch : 1.4.0
---
astroid/bases.py | 1 +
astroid/decorators.py | 7 +++----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/astroid/bases.py b/astroid/bases.py
index 90d1e4d6..edf6c4ac 100644
--- a/astroid/bases.py
+++ b/astroid/bases.py
@@ -289,6 +289,7 @@
class Generator(Instance):
def path_wrapper(func):
"""return the given infer function wrapped to handle the path"""
+ @functools.wraps(func)
def wrapped(node, context=None, _func=func, **kwargs):
"""wrapper function handling context"""
if context is None:
diff --git a/astroid/decorators.py b/astroid/decorators.py
index 2c6e40b7..a446536c 100644
--- a/astroid/decorators.py
+++ b/astroid/decorators.py
@@ -27,14 +27,13 @@
import wrapt
@wrapt.decorator
def cached(func, instance, args, kwargs):
"""Simple decorator to cache result of method calls without args."""
- wrapped_self, = args
- cache = getattr(wrapped_self, '__cache', None)
+ cache = getattr(instance, '__cache', None)
if cache is None:
- wrapped_self.__cache = cache = {}
+ instance.__cache = cache = {}
try:
return cache[func]
except KeyError:
- cache[func] = result = func(wrapped_self)
+ cache[func] = result = func(*args, **kwargs)
return result
--
2.35.1
component/pylint/buildout.cfg
View file @
0663f9d3
...
...
@@ -10,6 +10,7 @@ recipe = zc.recipe.egg:custom
egg = astroid
patches =
${:_profile_base_location_}/astroid-six_moves_import_error.patch#377beb0c50f52b9608bb6be7bf93096e
${:_profile_base_location_}/astroid-functools.wraps-needs-to-be-called-with-the-decorate.patch#1e76e79f16af1cf4897ea382146faac4
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
...
...
stack/erp5/buildout.cfg
View file @
0663f9d3
...
...
@@ -638,7 +638,7 @@ Zope2 = 2.13.30+SlapOSPatched001
## https://lab.nexedi.com/nexedi/slapos/merge_requests/648
pylint = 1.4.4+SlapOSPatched002
# astroid 1.4.1 breaks testDynamicClassGeneration
astroid = 1.3.8+SlapOSPatched00
1
astroid = 1.3.8+SlapOSPatched00
2
# use newer version than specified in ZTK
PasteDeploy = 1.5.2
...
...
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