Skip to content
Snippets Groups Projects
Commit 5e5621e2 authored by Sergey Sharybin's avatar Sergey Sharybin
Browse files

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.
parent 1225c1db
No related branches found
No related tags found
No related merge requests found
...@@ -38,13 +38,16 @@ import shutil ...@@ -38,13 +38,16 @@ import shutil
def CopyPythonLibs(dst, overwrite_lib, report=print): def CopyPythonLibs(dst, overwrite_lib, report=print):
import sysconfig import platform
src = sysconfig.get_paths()['platstdlib']
# Unix 'platstdlib' excludes 'lib', eg: # use python module to find pytohn's libpath
# '/usr/lib/python3.3' vs 'C:\blender\bin\2.58\python\Lib' src = os.path.dirname(platform.__file__)
# in both cases we have to end up with './2.58/python/lib'
if sys.platform[:3] != "win": # dst points to lib/, but src points to current python's library path, eg:
dst = os.path.join(dst, os.path.basename(src)) # '/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): if os.path.exists(src):
write = False write = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment