remove readlink (#9649)

This commit is contained in:
Brad Warren
2023-03-31 10:02:12 +11:00
committed by GitHub
parent 608d731e2b
commit 097af18417
2 changed files with 1 additions and 20 deletions
+1 -3
View File
@@ -11,11 +11,9 @@ import subprocess
import sys
import tempfile
import readlink
def find_tools_path():
return os.path.dirname(readlink.main(__file__))
return os.path.dirname(os.path.realpath(__file__))
def call_with_print(command, env=None):
-17
View File
@@ -1,17 +0,0 @@
#!/usr/bin/env python
"""Canonicalizes a path and follows any symlinks.
This is the equivalent of `readlink -f` on many Linux systems. This is
useful as there are often differences in readlink on different
platforms.
"""
import os
import sys
def main(link):
return os.path.realpath(link)
if __name__ == '__main__':
print(main(sys.argv[1]))