From 9bfcc84a6e5c2b1bdafb6fddf582b130ade5a424 Mon Sep 17 00:00:00 2001
From: Campbell Barton <ideasman42@gmail.com>
Date: Thu, 28 Jul 2011 09:25:10 +0000
Subject: [PATCH] fix [#27995] phyton32.dll caused "Appcrash" => Runtime
 crashes

---
 game_engine_save_as_runtime.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/game_engine_save_as_runtime.py b/game_engine_save_as_runtime.py
index 4e4a36d56..29b6b9d6c 100644
--- a/game_engine_save_as_runtime.py
+++ b/game_engine_save_as_runtime.py
@@ -40,8 +40,12 @@ import shutil
 def CopyPythonLibs(dst, overwrite_lib):
     import sysconfig
     src = sysconfig.get_paths()['platstdlib']
-    # X.XX/python/lib --> X.XX/python/lib/pythonX.X
-    dst = os.path.join(dst, os.path.basename(src))
+    # Unix 'platstdlib' excludes 'lib', eg:
+    #  '/usr/lib/python3.3' vs 'C:\blender\bin\2.58\python\Lib'
+    # in both cases we have to end up with './2.58/python/lib'
+    if sys.platform[:3] != "win":
+        dst = os.path.join(dst, os.path.basename(src))
+
     if os.path.exists(src):
         write = False
         if os.path.exists(dst):
-- 
GitLab