@@ -381,12 +381,12 @@ def from_filename(klass, filename):
381
381
return klass .from_file_map (file_map )
382
382
383
383
@classmethod
384
- def from_filespec (klass , img , filespec ):
384
+ def from_filespec (klass , filespec ):
385
385
warnings .warn ('``from_filespec`` class method is deprecated\n '
386
386
'Please use the ``from_filename`` class method '
387
387
'instead' ,
388
- DeprecationWarning )
389
- klass .from_filespec (filespec )
388
+ DeprecationWarning , stacklevel = 2 )
389
+ klass .from_filename (filespec )
390
390
391
391
@classmethod
392
392
def from_file_map (klass , file_map ):
@@ -397,7 +397,7 @@ def from_files(klass, file_map):
397
397
warnings .warn ('``from_files`` class method is deprecated\n '
398
398
'Please use the ``from_file_map`` class method '
399
399
'instead' ,
400
- DeprecationWarning )
400
+ DeprecationWarning , stacklevel = 2 )
401
401
return klass .from_file_map (file_map )
402
402
403
403
@classmethod
@@ -419,7 +419,7 @@ def filespec_to_files(klass, filespec):
419
419
warnings .warn ('``filespec_to_files`` class method is deprecated\n '
420
420
'Please use the ``filespec_to_file_map`` class method '
421
421
'instead' ,
422
- DeprecationWarning )
422
+ DeprecationWarning , stacklevel = 2 )
423
423
return klass .filespec_to_file_map (filespec )
424
424
425
425
def to_filename (self , filename ):
@@ -442,7 +442,7 @@ def to_filename(self, filename):
442
442
def to_filespec (self , filename ):
443
443
warnings .warn ('``to_filespec`` is deprecated, please '
444
444
'use ``to_filename`` instead' ,
445
- DeprecationWarning )
445
+ DeprecationWarning , stacklevel = 2 )
446
446
self .to_filename (filename )
447
447
448
448
def to_file_map (self , file_map = None ):
@@ -452,7 +452,7 @@ def to_files(self, file_map=None):
452
452
warnings .warn ('``to_files`` method is deprecated\n '
453
453
'Please use the ``to_file_map`` method '
454
454
'instead' ,
455
- DeprecationWarning )
455
+ DeprecationWarning , stacklevel = 2 )
456
456
self .to_file_map (file_map )
457
457
458
458
@classmethod
@@ -495,7 +495,7 @@ def save(klass, img, filename):
495
495
warnings .warn ('``save`` class method is deprecated\n '
496
496
'You probably want the ``to_filename`` instance '
497
497
'method, or the module-level ``save`` function' ,
498
- DeprecationWarning )
498
+ DeprecationWarning , stacklevel = 2 )
499
499
klass .instance_to_filename (img , filename )
500
500
501
501
@classmethod
0 commit comments