• Kirill Smelkov's avatar
    gpython: Preimport golang and gevent from exactly the same place as std python would do · 1f6f31cd
    Kirill Smelkov authored
    GPython preimports golang and gevent, but until now, it was preimporting
    them before adjusting sys.path according to given -c/-m/file/... And
    this was leading to difference in behaviour with standard Python where
    e.g. `import golang` might result in different files loaded if e.g.
    golang/ is there on cwd and -c/-m was given.
    
    -> Rework gpython startup so that golang/gevent preimport happens after
    sys.path initialization.
    
    This fixes `tox -e py27-gevent` which was previously failing on
    test_defer_excchain_dump_pytest / test_defer_excchain_dump_ipython
    because dumped paths were different than expected ones.
    
    It, however, breaks test_defer_excchain_traceback on py27-gevent.  ->
    We'll do more fixups to sys.path handling in the next patch which will
    fix that failure as well.
    1f6f31cd
__init__.py 12.3 KB