Explorar o código

idf.py: Don't expect "_" env. variable to be available from PowerShell

Roland Dobai %!s(int64=6) %!d(string=hai) anos
pai
achega
7971845fd4
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      tools/idf.py

+ 1 - 1
tools/idf.py

@@ -1113,7 +1113,7 @@ if __name__ == "__main__":
         WINPTY_VAR = "WINPTY"
         WINPTY_VAR = "WINPTY"
         WINPTY_EXE = "winpty"
         WINPTY_EXE = "winpty"
         if ("MSYSTEM" in os.environ) and (
         if ("MSYSTEM" in os.environ) and (
-            not os.environ["_"].endswith(WINPTY_EXE) and WINPTY_VAR not in os.environ
+            not os.environ.get("_", "").endswith(WINPTY_EXE) and WINPTY_VAR not in os.environ
         ):
         ):
             os.environ[WINPTY_VAR] = "1"  # the value is of no interest to us
             os.environ[WINPTY_VAR] = "1"  # the value is of no interest to us
             # idf.py calls itself with "winpty" and WINPTY global variable set
             # idf.py calls itself with "winpty" and WINPTY global variable set