Fix LGTM error: python default arguments are mutable\!
This commit is contained in:
parent
e37ef18c28
commit
267f202dad
1 changed files with 6 additions and 1 deletions
|
|
@ -72,7 +72,12 @@ class DebugSession( object ):
|
||||||
self._on_init_complete_handlers = []
|
self._on_init_complete_handlers = []
|
||||||
self._server_capabilities = {}
|
self._server_capabilities = {}
|
||||||
|
|
||||||
def Start( self, launch_variables = {} ):
|
def Start( self, launch_variables = None ):
|
||||||
|
# We mutate launch_variables, so don't mutate the default argument.
|
||||||
|
# https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments
|
||||||
|
if launch_variables is None:
|
||||||
|
launch_variables = {}
|
||||||
|
|
||||||
self._logger.info( "User requested start debug session with %s",
|
self._logger.info( "User requested start debug session with %s",
|
||||||
launch_variables )
|
launch_variables )
|
||||||
self._configuration = None
|
self._configuration = None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue