Skip to content

Commit beb3301

Browse files
readenv boolify string values
1 parent b979054 commit beb3301

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

numba_cuda/numba/cuda/cudadrv/driver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def _readenv(name, ctor, default):
6464
if value is None:
6565
return default() if callable(default) else default
6666
try:
67+
if ctor is bool:
68+
return bool(value.lower() in {'1', "True"})
6769
return ctor(value)
6870
except Exception:
6971
warnings.warn(
@@ -81,7 +83,6 @@ def _readenv(name, ctor, default):
8183
"to be available"
8284
)
8385

84-
8586
ENABLE_PYNVJITLINK = (
8687
_readenv("ENABLE_PYNVJITLINK", bool, False)
8788
or getattr(config, "ENABLE_PYNVJITLINK", None)

0 commit comments

Comments
 (0)