Skip to content

[dateutil] Check platform before imports#15573

Closed
eliroca wants to merge 1 commit intopython:mainfrom
eliroca:dateutil-tz-win-imports
Closed

[dateutil] Check platform before imports#15573
eliroca wants to merge 1 commit intopython:mainfrom
eliroca:dateutil-tz-win-imports

Conversation

@eliroca
Copy link
Copy Markdown

@eliroca eliroca commented Mar 29, 2026

Otherwise imports may fail on other platforms.

Otherwise imports may fail on other platforms.
@eliroca eliroca force-pushed the dateutil-tz-win-imports branch from d249db5 to 32a5e0d Compare March 29, 2026 19:34
@github-actions
Copy link
Copy Markdown
Contributor

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

@brianschubert
Copy link
Copy Markdown
Collaborator

Coming from #15574, as I understand it, this was a problem when checking the stubs with mypy 1.8.0, which doesn't include ctypes._NewTypes in its vendored copy of the stdlib stubs.

With current mypy / typeshed, these imports exist on all platforms, so I don't think this is necessary here.

For what it's worth, I'm not sure this helps with your use case either, since _NewTypes won't be defined if you ever check the stubs on Windows. In your forked stubs, it would probably make sense to either add a local copy of _NewTypes or to delete the win.pyi stubs altogether, depending on whether you intend to support Windows or not.

I'll go ahead and close this one, but thanks for the PR in any case! If you do find any other issues with the dateutil stubs, PRs are always welcome!

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