@@ -188,7 +188,7 @@ def default_secure(cfg: t.Any) -> None: # pragma: no cover
188188 If Session.key/keyfile have not been set, set Session.key to
189189 a new random UUID.
190190 """
191- warnings .warn ("default_secure is deprecated" , DeprecationWarning )
191+ warnings .warn ("default_secure is deprecated" , DeprecationWarning , stacklevel = 2 )
192192 if "Session" in cfg and ("key" in cfg .Session or "keyfile" in cfg .Session ):
193193 return
194194 # key/keyfile not specified, generate new UUID:
@@ -567,7 +567,7 @@ def __init__(self, **kwargs):
567567 self ._check_packers ()
568568 self .none = self .pack ({})
569569 # ensure self._session_default() if necessary, so bsession is defined:
570- self .session
570+ self .session # noqa
571571 self .pid = os .getpid ()
572572 self ._new_auth ()
573573 if not self .key :
@@ -861,9 +861,9 @@ def send(
861861 stream .send_multipart (to_send , copy = copy )
862862
863863 if self .debug :
864- pprint .pprint (msg )
865- pprint .pprint (to_send )
866- pprint .pprint (buffers )
864+ pprint .pprint (msg ) # noqa
865+ pprint .pprint (to_send ) # noqa
866+ pprint .pprint (buffers ) # noqa
867867
868868 msg ["tracker" ] = tracker
869869
@@ -1088,7 +1088,7 @@ def deserialize(
10881088 buffers = [memoryview (bytes (b .bytes )) for b in msg_list [5 :]]
10891089 message ["buffers" ] = buffers
10901090 if self .debug :
1091- pprint .pprint (message )
1091+ pprint .pprint (message ) # noqa
10921092 # adapt to the current version
10931093 return adapt (message )
10941094
@@ -1098,5 +1098,6 @@ def unserialize(self, *args: t.Any, **kwargs: t.Any) -> t.Dict[str, t.Any]:
10981098 warnings .warn (
10991099 "Session.unserialize is deprecated. Use Session.deserialize." ,
11001100 DeprecationWarning ,
1101+ stacklevel = 2 ,
11011102 )
11021103 return self .deserialize (* args , ** kwargs )
0 commit comments