remove readlink (#9649)

This commit is contained in:
Brad Warren 2023-03-30 16:02:12 -07:00 committed by GitHub
parent 608d731e2b
commit 097af18417
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 20 deletions

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):

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]))