Skip to content

Fix ModuleNotFoundError on Windows by making resource import optional - #162

Merged
shima004 merged 2 commits into
adf-python:mainfrom
NONONOexe:fix/windows-resource-import
Oct 16, 2026
Merged

shima004 merged 2 commits into
adf-python:mainfrom
NONONOexe:fix/windows-resource-import

Conversation

@NONONOexe

Copy link
Copy Markdown
Contributor

Summary

On Windows, import resource fails with ModuleNotFoundError,
because the resource module exists only on Unix-like systems.
This PR makes the import optional.

Changes

  • Wrap import resource in try/except ImportError and set resource = None on failure.
  • Call resource.setrlimit only when resource is available.

Testing

  • Windows (Python 3.13): from adf_core_python.launcher import Launcher works,
    and the launcher starts and waits for a server connection.

@NONONOexe
NONONOexe force-pushed the fix/windows-resource-import branch from 435802e to 733567b Compare October 16, 2026 05:33
@shima004
shima004 self-requested a review October 16, 2026 06:14
@shima004
shima004 merged commit 8ed5b8a into adf-python:main Oct 16, 2026
4 checks passed
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