all repos — mgba @ ce07344c7d87d8759fee16a64df78c516ee599bc

mGBA Game Boy Advance Emulator

Python: Support loading from a virtualenv
Vicki Pfau vi@endrift.com
Sun, 13 Aug 2017 18:09:58 -0700
commit

ce07344c7d87d8759fee16a64df78c516ee599bc

parent

0ba31c4e674a03c20c3798eb3e9994c8a185941f

1 files changed, 5 insertions(+), 0 deletions(-)

jump to
M src/platform/python/_builder.pysrc/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 = {