File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change
1
+ v4.6.1
2
+ ======
3
+
4
+ * #327: Deprecation warnings now honor call stack variance
5
+ on PyPy.
6
+
1
7
v4.6.0
2
8
======
3
9
Original file line number Diff line number Diff line change 7
7
import email
8
8
import pathlib
9
9
import operator
10
+ import platform
10
11
import textwrap
11
12
import warnings
12
13
import functools
48
49
]
49
50
50
51
52
+ def _pypy_partial (val ):
53
+ """
54
+ Adjust for variable stacklevel on partial under PyPy.
55
+
56
+ Workaround for #327.
57
+ """
58
+ is_pypy = platform .python_implementation () == 'PyPy'
59
+ return val + is_pypy
60
+
61
+
51
62
class PackageNotFoundError (ModuleNotFoundError ):
52
63
"""The package was not found."""
53
64
@@ -245,7 +256,7 @@ class DeprecatedList(list):
245
256
warnings .warn ,
246
257
"EntryPoints list interface is deprecated. Cast to list if needed." ,
247
258
DeprecationWarning ,
248
- stacklevel = 2 ,
259
+ stacklevel = _pypy_partial ( 2 ) ,
249
260
)
250
261
251
262
def __setitem__ (self , * args , ** kwargs ):
@@ -394,7 +405,7 @@ class Deprecated:
394
405
warnings .warn ,
395
406
"SelectableGroups dict interface is deprecated. Use select." ,
396
407
DeprecationWarning ,
397
- stacklevel = 2 ,
408
+ stacklevel = _pypy_partial ( 2 ) ,
398
409
)
399
410
400
411
def __getitem__ (self , name ):
You can’t perform that action at this time.
0 commit comments