Skip to content

Commit

Permalink
[py] fixed a bug in bidi/session.py by removing mutable object as d…
Browse files Browse the repository at this point in the history
…efault value for function argument. (#14286)
  • Loading branch information
sandeepsuryaprasad authored Oct 3, 2024
1 parent d1836b2 commit e8820b5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions py/selenium/webdriver/common/bidi/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,30 @@
# under the License.


def session_subscribe(*events, browsing_contexts=[]):
def session_subscribe(*events, browsing_contexts=None):
cmd_dict = {
"method": "session.subscribe",
"params": {
"events": events,
},
}
if browsing_contexts is None:
browsing_contexts = []
if browsing_contexts:
cmd_dict["params"]["browsingContexts"] = browsing_contexts
_ = yield cmd_dict
return None


def session_unsubscribe(*events, browsing_contexts=[]):
def session_unsubscribe(*events, browsing_contexts=None):
cmd_dict = {
"method": "session.unsubscribe",
"params": {
"events": events,
},
}
if browsing_contexts is None:
browsing_contexts = []
if browsing_contexts:
cmd_dict["params"]["browsingContexts"] = browsing_contexts
_ = yield cmd_dict
Expand Down

0 comments on commit e8820b5

Please sign in to comment.