Conversation
WindmillFinder's ModuleSpec lacked origin, so __file__ was never set on loaded modules. inspect.getfile() then raised "is a built-in module", breaking typeguard's @TypeChecked and anything else that introspects module source. Use spec_from_file_location() which sets origin correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deploying windmill with
|
| Latest commit: |
42eba98
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ca463de6.windmill.pages.dev |
| Branch Preview URL: | https://py-typechecked-decorator.windmill.pages.dev |
|
Claude finished @pyranota's task in 1m 8s —— View job PR Review: fix @TypeChecked decorator in Python relative imports
SummaryClean, well-scoped fix. The root cause is correctly identified: Code Review
Minor nit: from importlib.machinery import ModuleSpecTest ( Fixture ( No Issues FoundThe change is minimal, correct, and well-tested. No security, performance, or correctness concerns. Testing InstructionsTo verify this fix, create two Python scripts in a Windmill workspace. First, create a helper script at path |
WindmillFinder's ModuleSpec lacked origin, so file was never set on loaded modules. inspect.getfile() then raised "is a built-in module", breaking typeguard's @TypeChecked and anything else that introspects module source. Use spec_from_file_location() which sets origin correctly.