diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-10-01 17:32:27 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-10-01 17:32:27 -0400 |
commit | 5d83a2a06411b4dd6033427979011bbf9c594b46 (patch) | |
tree | 59e36228310ab7d63ae62b4b3221caf33e5ccf2d /cmd2 | |
parent | 9ca3476df3857cd5c89a5179e0e2578f95cb4425 (diff) | |
download | cmd2-git-5d83a2a06411b4dd6033427979011bbf9c594b46.tar.gz |
Remove self from pystate if locals_in_py is False
Diffstat (limited to 'cmd2')
-rw-r--r-- | cmd2/cmd2.py | 2 |
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 |