Skip to content

Commit 22de858

Browse files
committed
Updated comment
1 parent a2061ba commit 22de858

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd2/cmd2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,8 +3121,9 @@ def py_quit():
31213121
self._in_py = True
31223122
py_code_to_run = ''
31233123

3124-
# Use self.py_locals as the locals() dictionary in the Python environment we are creating, but make
3125-
# a copy to prevent pyscripts from editing it. (e.g. locals().clear()). Only make a shallow copy since
3124+
# Make a copy of self.py_locals for the locals dictionary in the Python environment we are creating.
3125+
# This is to prevent pyscripts from editing it. (e.g. locals().clear()). It also ensures a pyscript's
3126+
# environment won't be filled with data from a previously run pyscript. Only make a shallow copy since
31263127
# it's OK for py_locals to contain objects which are editable in a pyscript.
31273128
localvars = dict(self.py_locals)
31283129
localvars[self.py_bridge_name] = py_bridge

0 commit comments

Comments
 (0)