Skip to content

Commit ed1ed53

Browse files
aj-fuentesKangOl
andcommitted
[FIX] util/misc: split_osenv, do not return [""]
If the env var was not set we returned `[""]`. That was confusing. It also breaks the boolean check of the result. With this patch we just return an empty list when the variable is not set. See also: odoo/upgrade#8174 closes #299 Signed-off-by: Christophe Simonis (chs) <chs@odoo.com> Co-authored-by: Christophe Simonis (chs) <chs@odoo.com>
1 parent 6c9a30c commit ed1ed53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/misc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ def expand_braces(s):
189189

190190

191191
def split_osenv(name, default=""):
192-
return re.split(r"\W+", os.getenv(name, default).strip())
192+
value = os.getenv(name, default).strip()
193+
return re.split(r"\W+", value) if value else []
193194

194195

195196
try:

0 commit comments

Comments
 (0)