-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
FIX: Fixed incorrect module stripping in logging #13561
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
Conversation
|
I want to check if I should use removeprefix() instead of replace(), given that removeprefix is not supported in Python versions older than 3.9 |
Our minimum version is 3.10 I think, so removeprefix is fine |
d82969a to
29b1596
Compare
done, patched with removeprefix() |
hi @drammock , in that case as per the # TODO comment, patch is needed here too? Lines 35 to 41 in 0a88d41
|
Co-authored-by: Daniel McCloy <dan@mccloy.info>
Co-authored-by: Daniel McCloy <dan@mccloy.info>
Reference issue (if any)
None
What does this implement/fix?
This fixes a bug in mne.utils._logging._frame_info where lstrip('mne.') incorrectly removed characters from module names starting with 'm', 'n', 'e', or '.' due to treating the argument as a set of characters rather than a prefix.
Example:
Before: mne.event -> vent
After: mne.event -> event
Additional information
I want to check if I should use removeprefix() instead of replace(), given that removeprefix is not supported in Python versions older than 3.9