Skip to content

Commit d3bf345

Browse files
committed
chore: force osutils.abssymlink to internal, removing it
The only users of this is osutils.abspath which is slated for removal in 0.12.0, thus block any further usage of this. Signed-off-by: Brian Harring <ferringb@gmail.com>
1 parent 21fd6c4 commit d3bf345

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

NEWS.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ API deprecations
5050
- snakeoil.osutils.abspath: Will be removed in 0.12.0
5151
Use ``os.path.abspath``.
5252

53-
- snakeoil.osutils.abssymlink: Will be removed in 0.12.0
54-
Use ``os.path.*`` functions instead. Be mindful that this protected against //, which ``os.path.*`` doesn't, but ``pathlib`` should.
55-
5653
- snakeoil.osutils.join: Will be removed in 0.12.0
5754
Use ``os.path.join``.
5855

@@ -106,6 +103,7 @@ API removals
106103
- function snakeoil.modules.load_module
107104
- function snakeoil.obj.popattr
108105
- function snakeoil.osutils.access
106+
- function snakeoil.osutils.abssymlink
109107
- function snakeoil.osutils.readdir
110108
- function snakeoil.osutils.stat_swallow_enoent
111109
- function snakeoil.osutils.alias

src/snakeoil/osutils/__init__.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
__all__ = (
66
"abspath",
7-
"abssymlink",
87
"ensure_dirs",
98
"join",
109
"pjoin",
@@ -178,11 +177,7 @@ def ensure_dirs(path, gid=-1, uid=-1, mode=0o777, minimal=True):
178177
return True
179178

180179

181-
@deprecated(
182-
"Use os.path.* functions instead. Be mindful that this protected against //, which os.path.* doesn't, but pathlib should",
183-
removal_in=(0, 12, 0),
184-
)
185-
def abssymlink(path):
180+
def _abssymlink(path):
186181
"""Return the absolute path of a symlink
187182
188183
:param path: filepath to resolve
@@ -227,7 +222,7 @@ def abspath(path):
227222
"""
228223
path = os.path.abspath(path)
229224
try:
230-
return abssymlink(path)
225+
return _abssymlink(path)
231226
except EnvironmentError as e:
232227
if e.errno not in (errno.ENOENT, errno.EINVAL):
233228
raise

tests/test_osutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_abssymlink(self, tmp_path):
186186
linkname = tmp_path / "link"
187187
target.mkdir()
188188
linkname.symlink_to("target")
189-
assert osutils.abssymlink(linkname) == str(target)
189+
assert osutils._abssymlink(linkname) == str(target)
190190

191191

192192
@deprecated.suppress_deprecations()

0 commit comments

Comments
 (0)