Skip to content

fix: lazy-import fcntl to prevent crash on Windows#167

Open
kouyouqi123 wants to merge 1 commit into
Lexonight1:mainfrom
kouyouqi123:fix-fcntl-windows
Open

fix: lazy-import fcntl to prevent crash on Windows#167
kouyouqi123 wants to merge 1 commit into
Lexonight1:mainfrom
kouyouqi123:fix-fcntl-windows

Conversation

@kouyouqi123

Copy link
Copy Markdown

Fixes #166

Problem

linux.py has import fcntl at module level. On Windows, fcntl is not available (Unix-only), so importing trcc.adapters.system (which side-effect imports all OS modules) crashes with ModuleNotFoundError: No module named 'fcntl'.

Fix

Moved import fcntl from module level to inside the methods that use it, so it's only imported on Linux where those methods are actually called.

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.

Windows 11 - v9.7.0 imports trcc.adapters.system.linux and crashes with ModuleNotFoundError: fcntl

1 participant