Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-09-08 13:57:51 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-09-08 13:57:51 +0400
commit5e5621e2d59575d543cc5c0aa69e8b9466b4e6d9 (patch)
tree7a5abae98508b574cc541f42e3d2af1685d0b3c3 /game_engine_save_as_runtime.py
parent1225c1db9b5b57ad1db3233cb3bd8bf75061be3b (diff)
Fix for "save as runtime" plugin on linux.
It was broken since 2.58a and problem was caused by sysconfig module which tried to parse python configuration header (pyconfig.h). Use dirname(platform.__file__) to determine libpath for python.
Diffstat (limited to 'game_engine_save_as_runtime.py')
-rw-r--r--game_engine_save_as_runtime.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/game_engine_save_as_runtime.py b/game_engine_save_as_runtime.py
index b5a81d6d..b2b22521 100644
--- a/game_engine_save_as_runtime.py
+++ b/game_engine_save_as_runtime.py
@@ -38,13 +38,16 @@ import shutil
def CopyPythonLibs(dst, overwrite_lib, report=print):
- import sysconfig
- src = sysconfig.get_paths()['platstdlib']
- # 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))
+ import platform
+
+ # use python module to find pytohn's libpath
+ src = os.path.dirname(platform.__file__)
+
+ # dst points to lib/, but src points to current python's library path, eg:
+ # '/usr/lib/python3.2' vs '/usr/lib'
+ # append python's library dir name to destination, so only python's
+ # libraries would be copied
+ dst = os.path.join(dst, os.path.basename(src))
if os.path.exists(src):
write = False