File tree 2 files changed +7
-8
lines changed
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 49
49
from ._page import PageObject , _VirtualList
50
50
from ._page_labels import index2label as page_index2page_label
51
51
from ._utils import (
52
- deprecation_with_replacement ,
52
+ deprecate_with_replacement ,
53
53
logger_warning ,
54
54
parse_iso8824_date ,
55
55
)
@@ -1281,10 +1281,10 @@ def decode_permissions(
1281
1281
self , permissions_code : int
1282
1282
) -> Dict [str , bool ]: # pragma: no cover
1283
1283
"""Take the permissions as an integer, return the allowed access."""
1284
- deprecation_with_replacement (
1284
+ deprecate_with_replacement (
1285
1285
old_name = "decode_permissions" ,
1286
1286
new_name = "user_access_permissions" ,
1287
- removed_in = "6 .0.0" ,
1287
+ removed_in = "5 .0.0" ,
1288
1288
)
1289
1289
1290
1290
permissions_mapping = {
Original file line number Diff line number Diff line change 14
14
from pypdf .constants import PageAttributes as PG
15
15
from pypdf .constants import UserAccessPermissions as UAP
16
16
from pypdf .errors import (
17
- DeprecationError ,
18
17
EmptyFileError ,
19
18
FileNotDecryptedError ,
20
19
PdfReadError ,
@@ -746,16 +745,16 @@ def test_decode_permissions():
746
745
print_ = base .copy ()
747
746
print_ ["print" ] = True
748
747
with pytest .raises (
749
- DeprecationError ,
750
- match = "decode_permissions is deprecated and was removed in pypdf 6 .0.0. Use user_access_permissions instead" ,
748
+ DeprecationWarning ,
749
+ match = "decode_permissions is deprecated and will be removed in pypdf 5 .0.0. Use user_access_permissions instead" , # noqa: E501
751
750
):
752
751
assert reader .decode_permissions (4 ) == print_
753
752
754
753
modify = base .copy ()
755
754
modify ["modify" ] = True
756
755
with pytest .raises (
757
- DeprecationError ,
758
- match = "decode_permissions is deprecated and was removed in pypdf 6 .0.0. Use user_access_permissions instead" ,
756
+ DeprecationWarning ,
757
+ match = "decode_permissions is deprecated and will be removed in pypdf 5 .0.0. Use user_access_permissions instead" , # noqa: E501
759
758
):
760
759
assert reader .decode_permissions (8 ) == modify
761
760
You can’t perform that action at this time.
0 commit comments