summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-10-01 17:32:27 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-10-01 17:32:27 -0400
commit5d83a2a06411b4dd6033427979011bbf9c594b46 (patch)
tree59e36228310ab7d63ae62b4b3221caf33e5ccf2d /cmd2/cmd2.py
parent9ca3476df3857cd5c89a5179e0e2578f95cb4425 (diff)
downloadcmd2-git-5d83a2a06411b4dd6033427979011bbf9c594b46.tar.gz
Remove self from pystate if locals_in_py is False
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 03c71a91..e04138fa 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2982,6 +2982,8 @@ class Cmd(cmd.Cmd):
if self.locals_in_py:
self.pystate['self'] = self
+ elif 'self' in self.pystate:
+ del self.pystate['self']
localvars = self.pystate
from code import InteractiveConsole