From: Bruno Haible Date: Sat, 9 Sep 2017 08:21:00 +0000 (+0200) Subject: gnulib-tool.py: follow gnulib-tool changes, part 11 X-Git-Tag: v1.0~5933 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=17e4d7992bc1c91cd470cfb4b4b47898a92b67e5;p=gnulib.git gnulib-tool.py: follow gnulib-tool changes, part 11 Follow gnulib-tool change 2014-12-02 KO Myung-Hun gnulib-tool: recognize x:* as an absolute path --- diff --git a/pygnulib/constants.py b/pygnulib/constants.py index 6cb1ec97bb..9e0f19460a 100644 --- a/pygnulib/constants.py +++ b/pygnulib/constants.py @@ -344,16 +344,16 @@ def link_relative(src, dest): else: # if dest has not bytes or string type raise(TypeError( 'dest must be a string, not %s' % (type(dest).__name__))) - if src.startswith('/'): + if src.startswith('/') or (len(src) >= 2 and src[1] == ':'): os.symlink(src, dest) - else: # if not src.startswith('/') - if dest.startswith('/'): + else: # if src is not absolute + if dest.startswith('/') or (len(dest) >= 2 and dest[1] == ':'): if not constants.PYTHON3: cwd = os.getcwdu() else: # if constants.PYTHON3 cwd = os.getcwd() os.symlink(joinpath(cwd, src), dest) - else: # if not dest.startswith('/') + else: # if dest is not absolute destdir = os.path.dirname(dest) if not destdir: destdir = '.'