The ScopedThreadEnvironment seems broken in Python currently. Reproducer:
import mitsuba as mi
mi.set_variant("llvm_ad_rgb")
env = mi.ThreadEnvironment()
with mi.ScopedSetThreadEnvironment(env):
mi.Log(mi.LogLevel.Warn, "Log from a thread env")
This prints:
2024-08-12 14:58:04 WARN main [Thread] Destructor called while thread 'main' was still running
2024-08-12 14:58:04 WARN py0 [thread_env2.py:6] <module>: Log from a thread env
Traceback (most recent call last):
File ".../mitsuba3/build/thread_env2.py", line 5, in <module>
with mi.ScopedSetThreadEnvironment(env):
TypeError: __exit__(): incompatible function arguments. The following argument types are supported:
1. __exit__(self, arg0: object, arg1: object, arg2: object, /) -> None
Invoked with types: mitsuba.ScopedSetThreadEnvironment, NoneType, NoneType, NoneType
Likely just an issue in the bindings, but not immediately obvious to me what causes this. Aside of that, it seems that there are currently no tests exercising the ScopedThreadEnvironment in Python.
The ScopedThreadEnvironment seems broken in Python currently. Reproducer:
This prints:
Likely just an issue in the bindings, but not immediately obvious to me what causes this. Aside of that, it seems that there are currently no tests exercising the ScopedThreadEnvironment in Python.