diff --git a/.audit/oberstet_fix_1767.md b/.audit/oberstet_fix_1767.md new file mode 100644 index 000000000..62d4d20b3 --- /dev/null +++ b/.audit/oberstet_fix_1767.md @@ -0,0 +1,8 @@ +- [ ] I did **not** use any AI-assistance tools to help create this pull request. +- [x] I **did** use AI-assistance tools to *help* create this pull request. +- [x] I have read, understood and followed the projects' [AI Policy](https://github.com/crossbario/autobahn-python/blob/main/AI_POLICY.md) when creating code, documentation etc. for this pull request. + +Submitted by: @oberstet +Date: 2025-11-21 +Related issue(s): #1767 +Branch: oberstet:fix_1767 diff --git a/autobahn/websocket/__init__.py b/autobahn/websocket/__init__.py index 502fbf231..9f9eb57b9 100644 --- a/autobahn/websocket/__init__.py +++ b/autobahn/websocket/__init__.py @@ -43,9 +43,11 @@ # Step 1: Probe for NVX availability (was it built and can we import it?) _has_nvx = False try: - # Try importing both NVX modules to verify they're available - from autobahn.nvx._xormasker import create_xor_masker as _nvx_xor_test # noqa: F401 - from autobahn.nvx._utf8validator import Utf8Validator as _nvx_utf8_test # noqa: F401 + # Try importing the actual CFFI extension modules directly + # (not just the Python wrappers which are always importable) + # This correctly detects if NVX was actually built at install time + import _nvx_utf8validator # noqa: F401 + import _nvx_xormasker # noqa: F401 _has_nvx = True except ImportError: