##// END OF EJS Templates
posix: work around "posix" systems without os.link available (issue4974)...
Augie Fackler -
r27236:b0d90fef default
parent child Browse files
Show More
@@ -29,7 +29,16 b' from . import ('
29 posixfile = open
29 posixfile = open
30 normpath = os.path.normpath
30 normpath = os.path.normpath
31 samestat = os.path.samestat
31 samestat = os.path.samestat
32 oslink = os.link
32 try:
33 oslink = os.link
34 except AttributeError:
35 # Some platforms build Python without os.link on systems that are
36 # vaguely unix-like but don't have hardlink support. For those
37 # poor souls, just say we tried and that it failed so we fall back
38 # to copies.
39 def oslink(src, dst):
40 raise OSError(errno.EINVAL,
41 'hardlinks not supported: %s to %s' % (src, dst))
33 unlink = os.unlink
42 unlink = os.unlink
34 rename = os.rename
43 rename = os.rename
35 removedirs = os.removedirs
44 removedirs = os.removedirs
General Comments 0
You need to be logged in to leave comments. Login now