1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-26 07:41:33 +03:00
Files
certbot/tools/readlink.py
Mads Jensen c02b2d30f2 Removed Python legacy __future__ imports (#8697)
There are still some left, but the `modification_check` test fails. Some are still in `tools`, and they can probably be removed as well. `with_statement` was introduced officially in Python 2.5, so there's really old stuff in the code base.
2021-03-05 16:53:20 -08:00

18 lines
353 B
Python
Executable File

#!/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]))