]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
avoid 'OSError: [Errno 6] No such device or address' when calling set_env() method... mbs/fix_setenv 5/head
authormbs <martin.bernhard@opencascade.com>
Wed, 28 Jun 2023 16:37:54 +0000 (17:37 +0100)
committermbs <martin.bernhard@opencascade.com>
Wed, 28 Jun 2023 16:37:54 +0000 (17:37 +0100)
products/env_scripts/packagespy.py

index bb5498cdcb195cd592fad014d13d929d3179ae73..b9e26f3ba0df153f929adcc286ae2f0603e00d60 100644 (file)
@@ -4,9 +4,17 @@
 import os
 import platform
 import os
+import getpass
+
+def get_login():
+    try:
+        return os.getlogin()
+    except:
+        return getpass.getuser()
+
 def set_env(env, prereq_dir, version):
     env.set("PACKAGESPY_ROOT_DIR",prereq_dir)
-    env.set("WORKDIR4LOG",os.path.join('tmp', os.getlogin()))
+    env.set("WORKDIR4LOG",os.path.join('tmp', get_login()))
     env.prepend('PYTHONPATH',os.path.join(prereq_dir, 'packagespy'))
     env.prepend('PATH',os.path.join(prereq_dir,'packagespy','bin'))