summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
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