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

Optimize exception handling in import_module() #2224

Merged
merged 3 commits into from
Jun 27, 2023

Conversation

jacobtylerwalls
Copy link
Member

Type of Changes

Type
🔨 Refactoring

Description

Small performance boost. Don't repeat the same import operation for modules like ntpath that only exist on certain platforms (e.g. windows).

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Merging #2224 (00ef512) into main (efb34f2) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2224      +/-   ##
==========================================
+ Coverage   92.82%   92.92%   +0.09%     
==========================================
  Files          94       95       +1     
  Lines       10836    10922      +86     
==========================================
+ Hits        10059    10149      +90     
+ Misses        777      773       -4     
Flag Coverage Δ
linux 92.73% <100.00%> (+0.09%) ⬆️
pypy 91.07% <100.00%> (-0.18%) ⬇️
windows 92.49% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
astroid/nodes/scoped_nodes/scoped_nodes.py 92.66% <100.00%> (+0.04%) ⬆️

... and 10 files with indirect coverage changes

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
Copy link
Member Author

Thanks for the reviews!

@jacobtylerwalls jacobtylerwalls merged commit 2f8b636 into pylint-dev:main Jun 27, 2023
18 checks passed
@jacobtylerwalls jacobtylerwalls deleted the performance-boosts branch June 27, 2023 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants