-
Notifications
You must be signed in to change notification settings - Fork 180
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
[MRG] Update hide_modules.py #852
Changes from 3 commits
2702a13
7fe1702
3936fed
2b1283d
5471493
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,17 +26,13 @@ | |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
|
||
try: | ||
import importlib.abc | ||
import importlib.abc | ||
|
||
# py>=3.3 has MetaPathFinder | ||
_ModuleHiderBase = getattr(importlib.abc, "MetaPathFinder", importlib.abc.Finder) | ||
except ImportError: | ||
# py2 | ||
_ModuleHiderBase = object | ||
# py>=3.3 has MetaPathFinder | ||
_ModuleHiderBase = getattr(importlib.abc, "MetaPathFinder") | ||
|
||
|
||
class ModuleHider(_ModuleHiderBase): | ||
class ModuleHider(MetaPathFinder):: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo - double colon. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uh, how to add 3.11 and 3.12-dev to the CI tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I can just do it myself if you don't mind. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just did it - I hope you don't mind... |
||
"""Import finder hook to hide specified modules | ||
ModuleHider(hidden_modules) -> instance | ||
hidden_modules is a list of strings naming modules to hide. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why still use
getattr
? Actually, this variable should not be needed anymore, just use