summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-10-01 17:55:26 -0400
committerGitHub <noreply@github.com>2018-10-01 17:55:26 -0400
commit924f8a57a73de7da462e654f3937b134ca92dbc7 (patch)
tree59e36228310ab7d63ae62b4b3221caf33e5ccf2d /cmd2/cmd2.py
parent9ca3476df3857cd5c89a5179e0e2578f95cb4425 (diff)
parent5d83a2a06411b4dd6033427979011bbf9c594b46 (diff)
downloadcmd2-git-924f8a57a73de7da462e654f3937b134ca92dbc7.tar.gz
Merge pull request #559 from python-cmd2/self
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