• Kirill Smelkov's avatar
    gpython: Fix `gpython -X gpython.runtime=threads` to spawn subinterpreters... · ff0c1041
    Kirill Smelkov authored
    gpython: Fix `gpython -X gpython.runtime=threads` to spawn subinterpreters with threads runtime by default
    
    Previously it was not the case and gpython with default being gevent
    runtime was spawned even if parent gpython was instructed to use threads runtime:
    
        (z-dev) kirr@deca:~/src/tools/go/pygolang$ gpython -X gpython.runtime=threads
        Python 2.7.18 (default, Apr 28 2021, 17:39:59)
        [GCC 10.2.1 20210110] [GPython 0.1] [threads] on linux2
        Type "help", "copyright", "credits" or "license" for more information.
        (InteractiveConsole)
        >>> import sys
        >>> sys.version
        '2.7.18 (default, Apr 28 2021, 17:39:59) \n[GCC 10.2.1 20210110] [GPython 0.1] [threads]'   <-- NOTE threads
        >>> import subprocess
        subprocess.call(sys.executable)
        Python 2.7.18 (default, Apr 28 2021, 17:39:59)
        [GCC 10.2.1 20210110] [GPython 0.1] [gevent 21.1.2] on linux2                               <-- NOTE gevent
        Type "help", "copyright", "credits" or "license" for more information.
        (InteractiveConsole)
        >>>
    
    /proposed-for-review-on nexedi/pygolang!25
    ff0c1041
gpython_test.py 15.1 KB