diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-11-16 06:58:30 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-11-16 06:58:30 +0100 |
commit | dcffe49265eb5d1255b96fcbdba58a50db879fee (patch) | |
tree | 498cf4db1a14292430c9fc19a572419b1dac866d /src/engine/SCons/Tool/GettextCommon.py | |
parent | 8f2056eedecb0c2a7d794b78343d82cae50ffc38 (diff) | |
parent | e20c9557371eacec533588d33b4bebd543ba178f (diff) |
Merge tag 'upstream/2.4.1'
Upstream version 2.4.1
Diffstat (limited to 'src/engine/SCons/Tool/GettextCommon.py')
-rw-r--r-- | src/engine/SCons/Tool/GettextCommon.py | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/engine/SCons/Tool/GettextCommon.py b/src/engine/SCons/Tool/GettextCommon.py index af9b074..36f8fa2 100644 --- a/src/engine/SCons/Tool/GettextCommon.py +++ b/src/engine/SCons/Tool/GettextCommon.py @@ -24,7 +24,7 @@ Used by several tools of `gettext` toolset. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Tool/GettextCommon.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog" +__revision__ = "src/engine/SCons/Tool/GettextCommon.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog" import SCons.Warnings import re @@ -306,23 +306,6 @@ class RPaths(object): - Tuple of strings, which represent paths relative to current working directory (for given environment). """ - # os.path.relpath is available only on python >= 2.6. We use our own - # implementation. It's taken from BareNecessities package: - # http://jimmyg.org/work/code/barenecessities/index.html - from posixpath import curdir - def relpath(path, start=curdir): - import posixpath - """Return a relative version of a path""" - if not path: - raise ValueError("no path specified") - start_list = posixpath.abspath(start).split(posixpath.sep) - path_list = posixpath.abspath(path).split(posixpath.sep) - # Work out how much of the filepath is shared by start and path. - i = len(posixpath.commonprefix([start_list, path_list])) - rel_list = [posixpath.pardir] * (len(start_list)-i) + path_list[i:] - if not rel_list: - return posixpath.curdir - return posixpath.join(*rel_list) import os import SCons.Node.FS rpaths = () @@ -330,7 +313,7 @@ class RPaths(object): for node in nodes: rpath = None if isinstance(node, SCons.Node.FS.Base): - rpath = relpath(node.get_abspath(), cwd) + rpath = os.path.relpath(node.get_abspath(), cwd) # FIXME: Other types possible here? if rpath is not None: rpaths += (rpath,) |