Skip to content

Commit

Permalink
Update os.py
Browse files Browse the repository at this point in the history
Check if os provides link
  • Loading branch information
Deshdeepak1 committed Aug 17, 2023
1 parent 1456aa9 commit bdd8a7f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aiofiles/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
"makedirs",
"rmdir",
"removedirs",
"link",
"symlink",
"readlink",
"listdir",
"scandir",
"access",
"wrap",
]
if hasattr(os, "link"):
__all__ += ["link"]
if hasattr(os, "sendfile"):
__all__ += ["sendfile"]
if hasattr(os, "statvfs"):
Expand All @@ -40,13 +41,14 @@
makedirs = wrap(os.makedirs)
rmdir = wrap(os.rmdir)
removedirs = wrap(os.removedirs)
link = wrap(os.link)
symlink = wrap(os.symlink)
readlink = wrap(os.readlink)
listdir = wrap(os.listdir)
scandir = wrap(os.scandir)
access = wrap(os.access)

if hasattr(os, "link"):
link = wrap(os.link)
if hasattr(os, "sendfile"):
sendfile = wrap(os.sendfile)
if hasattr(os, "statvfs"):
Expand Down

0 comments on commit bdd8a7f

Please sign in to comment.