Python: Support loading from a virtualenv
Vicki Pfau vi@endrift.com
Sun, 13 Aug 2017 18:09:58 -0700
1 files changed,
5 insertions(+),
0 deletions(-)
jump to
M
src/platform/python/_builder.py
→
src/platform/python/_builder.py
@@ -71,6 +71,11 @@ lines.append(line)
ffi.embedding_api('\n'.join(lines)) ffi.embedding_init_code(""" + import os, os.path + venv = os.getenv('VIRTUAL_ENV') + if venv: + activate = os.path.join(venv, 'bin', 'activate_this.py') + execfile(activate, dict(__file__=activate)) from mgba._pylib import ffi, lib symbols = {} globalSyms = {