diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-11-16 05:58:16 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-11-16 05:58:16 +0100 |
commit | 60df8165e6be58369d76af4d38388c9846d82975 (patch) | |
tree | 827a72e604ad686e6817a40ff0dcaef405212276 /engine/SCons/Tool/GettextCommon.py | |
parent | 9948951ec4fcd3c29d7d7ba981de1d1fea275595 (diff) | |
parent | 6a570afd28bccdb118edde36488ba9834494d6c7 (diff) |
Merge tag 'upstream/2.4.1'
Upstream version 2.4.1
Diffstat (limited to 'engine/SCons/Tool/GettextCommon.py')
-rw-r--r-- | engine/SCons/Tool/GettextCommon.py | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/engine/SCons/Tool/GettextCommon.py b/engine/SCons/Tool/GettextCommon.py index af9b074..36f8fa2 100644 --- a/engine/SCons/Tool/GettextCommon.py +++ b/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,) |