@@ -55,13 +55,13 @@ class Delivery:
5555 def __init__ (self ):
5656 self .sent_session_warning = False
5757
58- def deliver (self , config , payload : Any , options = {} ):
58+ def deliver (self , config , payload : Any , options = None ):
5959 """
6060 Sends error reports to Bugsnag
6161 """
6262 pass
6363
64- def deliver_sessions (self , config , payload : Any ):
64+ def deliver_sessions (self , config , payload : Any , options = None ):
6565 """
6666 Sends sessions to Bugsnag
6767 """
@@ -72,10 +72,12 @@ def deliver_sessions(self, config, payload: Any):
7272 'No sessions will be sent to Bugsnag.' )
7373 self .sent_session_warning = True
7474 else :
75- options = {
76- 'endpoint' : config .session_endpoint ,
77- 'success' : 202 ,
78- }
75+ if options is None :
76+ options = {}
77+
78+ options ['endpoint' ] = config .session_endpoint
79+ options ['success' ] = 202
80+
7981 self .deliver (config , payload , options )
8082
8183 def queue_request (self , request : Callable , config , options : Dict ):
@@ -96,8 +98,9 @@ def safe_request():
9698
9799
98100class UrllibDelivery (Delivery ):
99-
100- def deliver (self , config , payload : Any , options = {}):
101+ def deliver (self , config , payload : Any , options = None ):
102+ if options is None :
103+ options = {}
101104
102105 def request ():
103106 uri = options .pop ('endpoint' , config .endpoint )
@@ -134,8 +137,9 @@ def request():
134137
135138
136139class RequestsDelivery (Delivery ):
137-
138- def deliver (self , config , payload : Any , options = {}):
140+ def deliver (self , config , payload : Any , options = None ):
141+ if options is None :
142+ options = {}
139143
140144 def request ():
141145 uri = options .pop ('endpoint' , config .endpoint )
0 commit comments