[IPython-dev] Ma branche

Fernando Perez fperez.net at gmail.com
Sun Aug 17 00:19:31 EDT 2008

On Sat, Aug 16, 2008 at 8:27 PM, Gael Varoquaux
<gael.varoquaux at normalesup.org> wrote:

[ on-list, so we keep code reviews there]

> Salut,
> Tu pourra marger ma branche avant la release ? J'ai un peu de
> changements, rien d'important, mais j'avais fais une erreur de conception
> avec le maniement des namespaces.


+def isolate_ipython0(func):
+    """ Decorator to isolate execution that involves an iptyhon0.
+    """
+    def my_func(*args, **kwargs):
+        ipython0 = get_ipython0().IP
+        user_ns = ipython0.user_ns
+        global_ns = ipython0.global_ns
+        func(*args, **kwargs)
+        ipython0.user_ns = user_ns
+        ipython0.global_ns = global_ns
+    return my_func

there should be:

  restore namespaces

so that if the test fails, the namespace handling isn't all mucked up, no?

Let me know when you change and I'll proceed.  Otherwise it looks OK.



More information about the IPython-dev mailing list