Skip to content

Commit fde06d5

Browse files
authored
fix TLS delete condition
1 parent 401491a commit fde06d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cuda_core/tests/conftest.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ def _device_unset_current():
4141
# no active context, do nothing
4242
return
4343
handle_return(driver.cuCtxPopCurrent())
44-
with _device._tls_lock:
45-
del _device._tls.devices
44+
if hasattr(_device._tls, "devices"):
45+
with _device._tls_lock:
46+
del _device._tls.devices
4647

4748

4849
@pytest.fixture(scope="function")

0 commit comments

Comments
 (0)