Skip to content
Snippets Groups Projects
Commit f2ac9bb8 authored by Nilesh Patra's avatar Nilesh Patra
Browse files

Add patch to fix FTBFS with new pylint (Closes: #1021889)

parent 9585a4ee
No related branches found
No related tags found
No related merge requests found
Description: pylint >=2.13 has changed args in ScopeConsumer, fixing it accordingly
Author: Nilesh Patra <nilesh@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021889
Forwarded: not-needed, aleady fixed upstream
Last-Update: 2022-10-16
--- a/pylint_django/augmentations/__init__.py
+++ b/pylint_django/augmentations/__init__.py
@@ -314,7 +314,16 @@
continue
new_things[name] = stmts
- consumer._atomic = ScopeConsumer(new_things, consumer.consumed, consumer.scope_type) # pylint: disable=W0212
+ # ScopeConsumer changed between pylint 2.12 and 2.13
+ # see https://github.com/PyCQA/pylint/issues/5970#issuecomment-1078778393
+ if hasattr(consumer, "consumed_uncertain"):
+ # this is pylint >= 2.13, and the ScopeConsumer tuple has an additional field
+ sc_args = (new_things, consumer.consumed, consumer.consumed_uncertain, consumer.scope_type)
+ else:
+ # this is <2.13 and does not have the consumer_uncertain field
+ sc_args = (new_things, consumer.consumed, consumer.scope_type)
+
+ consumer._atomic = ScopeConsumer(*sc_args) # pylint: disable=W0212
self._to_consume = [consumer] # pylint: disable=W0212
return orig_method(self, node)
fix-pylint.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment