File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1265,7 +1265,7 @@ def link_to(self, target):
12651265 warnings .warn ("pathlib.Path.link_to() is deprecated and is scheduled "
12661266 "for removal in Python 3.12. "
12671267 "Use pathlib.Path.hardlink_to() instead." ,
1268- DeprecationWarning )
1268+ DeprecationWarning , stacklevel = 2 )
12691269 self ._accessor .link (self , target )
12701270
12711271 # Convenience functions for querying the stat results
Original file line number Diff line number Diff line change @@ -1934,7 +1934,8 @@ def test_link_to(self):
19341934 self .assertTrue (p .stat )
19351935 # Linking to a str of a relative path.
19361936 r = rel_join ('fileAAA' )
1937- q .link_to (r )
1937+ with self .assertWarns (DeprecationWarning ):
1938+ q .link_to (r )
19381939 self .assertEqual (os .stat (r ).st_size , size )
19391940 self .assertTrue (q .stat )
19401941
You can’t perform that action at this time.
0 commit comments