From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4FA341387A5 for ; Thu, 31 Jan 2013 19:56:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D500B21C00F; Thu, 31 Jan 2013 19:56:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7AE1921C00F for ; Thu, 31 Jan 2013 19:56:32 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 93F9033DC58 for ; Thu, 31 Jan 2013 19:56:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 0B767E4073 for ; Thu, 31 Jan 2013 19:56:30 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1359662173.88e8f1fcc212c93b5dc35dd441f1431986de07b7.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/tests/runTests X-VCS-Directories: pym/portage/tests/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 88e8f1fcc212c93b5dc35dd441f1431986de07b7 X-VCS-Branch: master Date: Thu, 31 Jan 2013 19:56:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4e2da897-7d91-4a50-9635-ff39a096f336 X-Archives-Hash: 7b6f8ccdacf1eaaed31ceba84f7d68e5 commit: 88e8f1fcc212c93b5dc35dd441f1431986de07b7 Author: Zac Medico gentoo org> AuthorDate: Thu Jan 31 19:56:13 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Jan 31 19:56:13 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=88e8f1fc runTests: handle samefile OSError, bug #454880 --- pym/portage/tests/runTests | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pym/portage/tests/runTests b/pym/portage/tests/runTests index 53e1b5c..b006969 100755 --- a/pym/portage/tests/runTests +++ b/pym/portage/tests/runTests @@ -1,6 +1,6 @@ #!/usr/bin/python -Wd # runTests.py -- Portage Unit Test Functionality -# Copyright 2006-2012 Gentoo Foundation +# Copyright 2006-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import os, sys @@ -45,11 +45,17 @@ import portage.tests as tests from portage.const import PORTAGE_BIN_PATH path = os.environ.get("PATH", "").split(":") path = [x for x in path if x] -if not path or not os.path.samefile(path[0], PORTAGE_BIN_PATH): + +insert_bin_path = True +try: + insert_bin_path = not path or \ + not os.path.samefile(path[0], PORTAGE_BIN_PATH) +except OSError: + pass + +if insert_bin_path: path.insert(0, PORTAGE_BIN_PATH) os.environ["PATH"] = ":".join(path) -del path - if __name__ == "__main__": sys.exit(tests.main())