This fixes a bug in the previous version where if the code does not use top level await but returns a generator or coroutine, the code would try to await it. This sometimes causes strange errors or other unexpected behaviors.

Instead, I switched to a new method of returning by raising an exception. This makes it so the coroutines produced by top level await are returned via a separate channel from return values from the code so we won't confuse them anymore.

I added a new class Executor. On creation, the Executor is given the source code and config options and produces an AST. The caller can then manipulate the AST as they see fit before calling `compile` and then `run` or `run_async`. This passes to the user the most powerful possible interface, and should make it so that Executor is helpful even in complicated use cases.

I put the main parse/compile logic into a separate generator to avoid storing any of the config options on the Executor class. This helps separate out control logic from config options and limit the scope of variables as far as possible.
ENH Improvements to eval_code. This fixes a bug in the previous version where if the code does not use top level await but returns a generator or coroutine, the code would try to await it. This sometimes causes strange errors or other unexpected behaviors.

Instead, I switched to a new method of returning by raising an exception. This makes it so the coroutines produced by top level await are returned via a separate channel from return values from the code so we won't confuse them anymore.

I added a new class Executor. On creation, the Executor is given the source code and config options and produces an AST. The caller can then manipulate the AST as they see fit before calling `compile` and then `run` or `run_async`. This passes to the user the most powerful possible interface, and should make it so that Executor is helpful even in complicated use cases.

I put the main parse/compile logic into a separate generator to avoid storing any of the config options on the Executor class. This helps separate out control logic from config options and limit the scope of variables as far as possible.
commit d6740caa7400105a578ace74f8c25bbb3434178c
Author: Roman Yurchak <rth.yurchak@pm.me>
Date:   Wed Oct 10 14:47:12 2018 +0200

    Disable scipy.stats.mvn

diff --git a/scipy/stats/kde.py b/scipy/stats/kde.py
index 7c702a038..8b0ab0254 100644
--- a/scipy/stats/kde.py
+++ b/scipy/stats/kde.py
@@ -32,7 +32,10 @@ import numpy as np
 from numpy.random import randint, multivariate_normal
 
 # Local imports.
-from . import mvn
+try:
+    from . import mvn
+except ImportError:
+    mvn = None
 
 
 __all__ = ['gaussian_kde']
diff --git a/scipy/stats/setup.py b/scipy/stats/setup.py
index f1a02df4e..7366ec12d 100755
--- a/scipy/stats/setup.py
+++ b/scipy/stats/setup.py
@@ -32,9 +32,9 @@ def configuration(parent_package='',top_path=None):
     )
 
     # add mvn module
-    config.add_extension('mvn',
-        sources=['mvn.pyf','mvndst.f'],
-    )
+    #config.add_extension('mvn',
+    #    sources=['mvn.pyf','mvndst.f'],
+    #)
 
     return config
 

commit d6740caa7400105a578ace74f8c25bbb3434178c
Author: Roman Yurchak <rth.yurchak@pm.me>
Date:   Wed Oct 10 14:47:12 2018 +0200

    Disable scipy.stats.mvn

diff --git a/scipy/stats/kde.py b/scipy/stats/kde.py
index 7c702a038..8b0ab0254 100644
--- a/scipy/stats/kde.py
+++ b/scipy/stats/kde.py
@@ -32,7 +32,10 @@ import numpy as np
 from numpy.random import randint, multivariate_normal
 
 # Local imports.
-from . import mvn
+try:
+    from . import mvn
+except ImportError:
+    mvn = None
 
 
 __all__ = ['gaussian_kde']
diff --git a/scipy/stats/setup.py b/scipy/stats/setup.py
index f1a02df4e..7366ec12d 100755
--- a/scipy/stats/setup.py
+++ b/scipy/stats/setup.py
@@ -32,9 +32,9 @@ def configuration(parent_package='',top_path=None):
     )
 
     # add mvn module
-    config.add_extension('mvn',
-        sources=['mvn.pyf','mvndst.f'],
-    )
+    #config.add_extension('mvn',
+    #    sources=['mvn.pyf','mvndst.f'],
+    #)
 
     return config
 
