Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 39904:5fe0b880200e
py3: convert os.readlink() path to native strings on Windows
Windows insisted that it needs to be str. I skipped the stuff in the posix
module, and left `tests/f` and `run-tests.py` alone for now.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 25 Sep 2018 21:16:12 -0400 |
parents | b63dee7bd0d9 |
children | 4017968f0a1d |
comparison
equal
deleted
inserted
replaced
39903:803b7569c9ea | 39904:5fe0b880200e |
---|---|
110 oslink = platform.oslink | 110 oslink = platform.oslink |
111 parsepatchoutput = platform.parsepatchoutput | 111 parsepatchoutput = platform.parsepatchoutput |
112 pconvert = platform.pconvert | 112 pconvert = platform.pconvert |
113 poll = platform.poll | 113 poll = platform.poll |
114 posixfile = platform.posixfile | 114 posixfile = platform.posixfile |
115 readlink = platform.readlink | |
115 rename = platform.rename | 116 rename = platform.rename |
116 removedirs = platform.removedirs | 117 removedirs = platform.removedirs |
117 samedevice = platform.samedevice | 118 samedevice = platform.samedevice |
118 samefile = platform.samefile | 119 samefile = platform.samefile |
119 samestat = platform.samestat | 120 samestat = platform.samestat |
1839 os.write(ld, info) | 1840 os.write(ld, info) |
1840 os.close(ld) | 1841 os.close(ld) |
1841 | 1842 |
1842 def readlock(pathname): | 1843 def readlock(pathname): |
1843 try: | 1844 try: |
1844 return os.readlink(pathname) | 1845 return readlink(pathname) |
1845 except OSError as why: | 1846 except OSError as why: |
1846 if why.errno not in (errno.EINVAL, errno.ENOSYS): | 1847 if why.errno not in (errno.EINVAL, errno.ENOSYS): |
1847 raise | 1848 raise |
1848 except AttributeError: # no symlink in os | 1849 except AttributeError: # no symlink in os |
1849 pass | 1850 pass |