Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent a crash when a module's __path__ is missing #1833

Merged
merged 1 commit into from Oct 15, 2022

Conversation

jacobtylerwalls
Copy link
Member

Steps

  • For new features or bug fixes, add a ChangeLog entry describing what your PR does.
  • Write a good description on what the PR does.

Description

We have several reports of modules missing a __path__ attribute. I couldn't determine how to reproduce it realistically, so I just mocked it in a test.

Type of Changes

Type
🐛 Bug fix

Related Issue

Closes pylint-dev/pylint#7592

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3256390020

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 92.271%

Files with Coverage Reduction New Missed Lines %
astroid/interpreter/_import/util.py 3 87.23%
Totals Coverage Status
Change from base Build 3255028730: -0.03%
Covered Lines: 9861
Relevant Lines: 10687

💛 - Coveralls

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@jacobtylerwalls jacobtylerwalls merged commit 05b8e8b into pylint-dev:main Oct 15, 2022
@jacobtylerwalls jacobtylerwalls deleted the missing-path branch October 15, 2022 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: module <module> has no attribute '__path__'
3 participants