From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1B0DB158020 for ; Sun, 25 Dec 2022 18:27:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4DDECE08A8; Sun, 25 Dec 2022 18:27:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 35B27E08A8 for ; Sun, 25 Dec 2022 18:27:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4773B34107C for ; Sun, 25 Dec 2022 18:27:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CC6926F2 for ; Sun, 25 Dec 2022 18:27:10 +0000 (UTC) From: "Arthur Zamarin" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" Message-ID: <1671992797.2e4f73760dcbf1fb15bea4c6a89e4a65012ef74d.arthurzam@gentoo> Subject: [gentoo-commits] proj/pkgcore/snakeoil:master commit in: src/snakeoil/osutils/, tests/ X-VCS-Repository: proj/pkgcore/snakeoil X-VCS-Files: src/snakeoil/osutils/__init__.py src/snakeoil/osutils/native_readdir.py tests/test_osutils.py X-VCS-Directories: src/snakeoil/osutils/ tests/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: 2e4f73760dcbf1fb15bea4c6a89e4a65012ef74d X-VCS-Branch: master Date: Sun, 25 Dec 2022 18:27:10 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 52114fae-c162-458d-bcc8-5994bcfa1346 X-Archives-Hash: 104c6da295411ed84d350b2b595f5e99 commit: 2e4f73760dcbf1fb15bea4c6a89e4a65012ef74d Author: Arthur Zamarin gentoo org> AuthorDate: Fri Dec 23 21:37:47 2022 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Sun Dec 25 18:26:37 2022 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=2e4f7376 remove osutils.native_readdir.listdir Signed-off-by: Arthur Zamarin gentoo.org> src/snakeoil/osutils/__init__.py | 2 +- src/snakeoil/osutils/native_readdir.py | 2 -- tests/test_osutils.py | 8 +------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/snakeoil/osutils/__init__.py b/src/snakeoil/osutils/__init__.py index 036a78df..1910859b 100644 --- a/src/snakeoil/osutils/__init__.py +++ b/src/snakeoil/osutils/__init__.py @@ -59,7 +59,7 @@ from . import native_readdir as module # force utf8 codepaths yet. from ..klass import steal_docs -listdir = module.listdir +listdir = os.listdir listdir_dirs = module.listdir_dirs listdir_files = module.listdir_files readdir = module.readdir diff --git a/src/snakeoil/osutils/native_readdir.py b/src/snakeoil/osutils/native_readdir.py index b129a9bf..d7c2fd91 100644 --- a/src/snakeoil/osutils/native_readdir.py +++ b/src/snakeoil/osutils/native_readdir.py @@ -18,8 +18,6 @@ from stat import ( from ..mappings import ProtectedDict -listdir = os.listdir - # we can still use the cpy pjoin here, just need to do something about the # import cycle. pjoin = os.path.join diff --git a/tests/test_osutils.py b/tests/test_osutils.py index 264d670d..fac98532 100644 --- a/tests/test_osutils.py +++ b/tests/test_osutils.py @@ -18,8 +18,7 @@ from snakeoil.osutils.mount import MNT_DETACH, MS_BIND, mount, umount class ReaddirCommon: @pytest.fixture def subdir(self, tmp_path): - subdir = tmp_path / "dir" - subdir.mkdir() + (subdir := tmp_path / "dir").mkdir() (tmp_path / "file").touch() os.mkfifo((tmp_path / "fifo")) return subdir @@ -30,10 +29,6 @@ class ReaddirCommon: class TestNativeListDir(ReaddirCommon): - def test_listdir(self, tmp_path, subdir): - assert set(native_readdir.listdir(tmp_path)) == {"dir", "fifo", "file"} - assert native_readdir.listdir(subdir) == [] - def test_listdir_dirs(self, tmp_path, subdir): assert native_readdir.listdir_dirs(tmp_path) == ["dir"] assert native_readdir.listdir_dirs(subdir) == [] @@ -46,7 +41,6 @@ class TestNativeListDir(ReaddirCommon): return self._test_missing( tmp_path, ( - native_readdir.listdir, native_readdir.listdir_dirs, native_readdir.listdir_files, ),