Closed
Description
Bug description
pylint is confusing ExitStack() and AsyncExitStack() when analyzing two different modules using each.
Consider as a minimized example, the following two modules.
sync.py
from contextlib import ExitStack
def sync_stack_use():
stack = ExitStack()
stack.pop_all().close()
async.py
from contextlib import AsyncExitStack
def async_stack_use():
stack = AsyncExitStack()
stack.pop_all().aclose()
Configuration
No response
Command used
1. pylint --disable=all --enable=no-member sync.py
2. pylint --disable=all --enable=no-member async.py
3. pylint --disable=all --enable=no-member sync.py async.py
4. pylint --disable=all --enable=no-member async.py sync.py
Pylint output
1. no finding
2. no finding
3. async.py:4:4: E1101: Instance of 'ExitStack' has no 'aclose' member; maybe 'close'? (no-member)
4. sync.py:4:4: E1101: Instance of 'AsyncExitStack' has no 'close' member; maybe 'aclose'? (no-member)
Expected behavior
- no finding
- no finding
- no finding
- no finding
Pylint version
pylint 2.15.2
astroid 2.12.9
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]
OS / Environment
Windows (reproduced also on Ubuntu 20.04 LTS).
Additional dependencies
No response