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

Accept mtime=None in linecache.cache entries. #7623

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Accept mtime=None in linecache.cache entries. #7623

merged 1 commit into from
Apr 14, 2022

Conversation

till-varoquaux
Copy link
Contributor

The mtime in linecache entries can be set to None fir files loaded via a __loader__ (cf: https://github.com/python/cpython/blob/3.10/Lib/linecache.py#L70)

@@ -7,7 +7,7 @@ else:
__all__ = ["getline", "clearcache", "checkcache"]

_ModuleGlobals = dict[str, Any]
_ModuleMetadata = tuple[int, float, list[str], str]
_ModuleMetadata = tuple[int, float, list[str] | None, str]
Copy link
Member

Choose a reason for hiding this comment

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

Isn't mtime the second item in the tuple, rather than the third item?

https://github.com/python/cpython/blob/3.10/Lib/linecache.py#L68

Copy link
Contributor Author

@till-varoquaux till-varoquaux Apr 14, 2022

Choose a reason for hiding this comment

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

Oops, you're right. Fixed.

@github-actions

This comment has been minimized.

The mtime in linecache entries can be set to `None` fir files loaded via a `__loader__` (cf: https://github.com/python/cpython/blob/3.10/Lib/linecache.py#L70)
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit 7f9be7f into python:master Apr 14, 2022
@till-varoquaux till-varoquaux deleted the patch-1 branch April 14, 2022 16:25
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.

2 participants