mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
#4351: more appropriate DeprecationWarning stacklevels
This commit is contained in:
parent
6f9977852f
commit
d846f1d4c2
9 changed files with 22 additions and 16 deletions
|
@ -124,7 +124,7 @@ class GzipFile:
|
|||
@property
|
||||
def filename(self):
|
||||
import warnings
|
||||
warnings.warn("use the name attribute", DeprecationWarning)
|
||||
warnings.warn("use the name attribute", DeprecationWarning, 2)
|
||||
if self.mode == WRITE and self.name[-3:] != ".gz":
|
||||
return self.name + ".gz"
|
||||
return self.name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue