From 78a426112415c0e9721e63a3c10e62d12398a5d3 2007-12-07 10:59:06 From: vivainio Date: 2007-12-07 10:59:06 Subject: [PATCH] Do not replace # w/ \# anymore --- diff --git a/IPython/Extensions/ipy_profile_sh.py b/IPython/Extensions/ipy_profile_sh.py index 887a694..7a68639 100644 --- a/IPython/Extensions/ipy_profile_sh.py +++ b/IPython/Extensions/ipy_profile_sh.py @@ -134,7 +134,7 @@ def extend_shell_behavior(ip): # utility to expand user variables via Itpl # xxx do something sensible with depth? ip.IP.var_expand = lambda cmd, lvars=None, depth=2: \ - str(ItplNS(cmd.replace('#','\#'), ip.IP.user_ns, get_locals())) + str(ItplNS(cmd, ip.IP.user_ns, get_locals())) def get_locals(): """ Substituting a variable through Itpl deep inside the IPSHELL stack diff --git a/IPython/iplib.py b/IPython/iplib.py index b00236e..4c5d9b2 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.3 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 2871 2007-11-25 04:28:19Z fperez $ +$Id: iplib.py 2885 2007-12-07 10:59:06Z vivainio $ """ #***************************************************************************** @@ -618,7 +618,7 @@ class InteractiveShell(object,Magic): namespace. """ - return str(ItplNS(cmd.replace('#','\#'), + return str(ItplNS(cmd, self.user_ns, # globals # Skip our own frame in searching for locals: sys._getframe(depth+1).f_locals # locals