File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def _loadData(self, data):
7575 self .updatedAt = utils .toDatetime (data .attrib .get ('updatedAt' ))
7676
7777 @property
78- @deprecated ('use "items" instead' )
78+ @deprecated ('use "items" instead' , stacklevel = 3 )
7979 def children (self ):
8080 return self .items ()
8181
Original file line number Diff line number Diff line change 2121 tqdm = None
2222
2323log = logging .getLogger ('plexapi' )
24- warnings .simplefilter ('default' , category = DeprecationWarning )
2524
2625# Search Types - Plex uses these to filter specific media types when searching.
2726# Library Types - Populated at runtime
@@ -467,15 +466,15 @@ def base64str(text):
467466 return base64 .b64encode (text .encode ('utf-8' )).decode ('utf-8' )
468467
469468
470- def deprecated (message ):
469+ def deprecated (message , stacklevel = 2 ):
471470 def decorator (func ):
472471 """This is a decorator which can be used to mark functions
473472 as deprecated. It will result in a warning being emitted
474473 when the function is used."""
475474 @functools .wraps (func )
476475 def wrapper (* args , ** kwargs ):
477476 msg = 'Call to deprecated function or method "%s", %s.' % (func .__name__ , message )
478- warnings .warn (msg , category = DeprecationWarning , stacklevel = 3 )
477+ warnings .warn (msg , category = DeprecationWarning , stacklevel = stacklevel )
479478 log .warning (msg )
480479 return func (* args , ** kwargs )
481480 return wrapper
You can’t perform that action at this time.
0 commit comments