From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-561434-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 17525138B4A for <garchives@archives.gentoo.org>; Wed, 20 Feb 2013 19:58:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A018EE05A5; Wed, 20 Feb 2013 19:58:13 +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 3B8F0E05A5 for <gentoo-commits@lists.gentoo.org>; Wed, 20 Feb 2013 19:58:13 +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 07A8533DFF3 for <gentoo-commits@lists.gentoo.org>; Wed, 20 Feb 2013 19:58:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 6D762E4073 for <gentoo-commits@lists.gentoo.org>; Wed, 20 Feb 2013 19:58:10 +0000 (UTC) From: "Arfrever Frehtes Taifersar Arahesis" <arfrever.fta@gmail.com> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arfrever Frehtes Taifersar Arahesis" <arfrever.fta@gmail.com> Message-ID: <1361390033.e8d1337b5936ee058872d25f21b914e96bcbf677.arfrever@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/lint/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/tests/lint/test_compile_modules.py X-VCS-Directories: pym/portage/tests/lint/ X-VCS-Committer: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis X-VCS-Revision: e8d1337b5936ee058872d25f21b914e96bcbf677 X-VCS-Branch: master Date: Wed, 20 Feb 2013 19:58:10 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 782f5752-5725-4670-832e-74517fdd3018 X-Archives-Hash: d879878e44b9456275c9f30f051c970c commit: e8d1337b5936ee058872d25f21b914e96bcbf677 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org> AuthorDate: Wed Feb 20 19:53:53 2013 +0000 Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com> CommitDate: Wed Feb 20 19:53:53 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e8d1337b testCompileModules(): Use builtins.compile() instead of py_compile.compile() to avoid replacing /dev/null character device with a regular file when using Python 3.4 (http://bugs.python.org/issue17222). --- pym/portage/tests/lint/test_compile_modules.py | 20 +++++++++----------- 1 files changed, 9 insertions(+), 11 deletions(-) diff --git a/pym/portage/tests/lint/test_compile_modules.py b/pym/portage/tests/lint/test_compile_modules.py index f90a666..1d44e68 100644 --- a/pym/portage/tests/lint/test_compile_modules.py +++ b/pym/portage/tests/lint/test_compile_modules.py @@ -1,4 +1,4 @@ -# Copyright 2009-2010 Gentoo Foundation +# Copyright 2009-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import itertools @@ -10,8 +10,6 @@ from portage import os from portage import _encodings from portage import _unicode_decode, _unicode_encode -import py_compile - class CompileModulesTestCase(TestCase): def testCompileModules(self): @@ -34,13 +32,13 @@ class CompileModulesTestCase(TestCase): do_compile = True else: # Check for python shebang - f = open(_unicode_encode(x, - encoding=_encodings['fs'], errors='strict'), 'rb') - line = _unicode_decode(f.readline(), - encoding=_encodings['content'], errors='replace') - f.close() - if line[:2] == '#!' and \ - 'python' in line: + with open(_unicode_encode(x, + encoding=_encodings['fs'], errors='strict'), 'rb') as f: + line = _unicode_decode(f.readline(), + encoding=_encodings['content'], errors='replace') + if line[:2] == '#!' and 'python' in line: do_compile = True if do_compile: - py_compile.compile(x, cfile='/dev/null', doraise=True) + with open(_unicode_encode(x, + encoding=_encodings['fs'], errors='strict'), 'rb') as f: + compile(f.read(), x, 'exec')