Skip to content

Commit 1e57518

Browse files
author
Release Manager
committed
sagemathgh-40388: Do not ignore env.py fallbacks for empty variables in config.py If a variable is set to the empty string in config.py, consider the fallbacks defined in env.py In particular, this fixes MATHJAX_DIR outside sage-the-distro URL: sagemath#40388 Reported by: Antonio Rojas Reviewer(s):
2 parents 1cfff6a + a0f4e53 commit 1e57518

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sage/env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
159159
except ImportError:
160160
pass
161161

162-
# Try all fallbacks in order as long as we don't have a value
162+
# Try all fallbacks in order as long as we don't have a non-empty value
163163
for f in fallbacks:
164-
if value is not None:
164+
if value not in (None, ""):
165165
break
166166
value = f
167167
SAGE_ENV[key] = value

0 commit comments

Comments
 (0)