summaryrefslogtreecommitdiff
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2012-01-10 20:25:09 +0100
committerCharles-François Natali <neologix@free.fr>2012-01-10 20:25:09 +0100
commit76961faaa0323580caac8068848c33b7aeec13ee (patch)
tree3ee6487ceb4e3c4674aabd0f92d7e06a1a09c09e /Lib/test/test_posix.py
parentbda7a80194849eb2797c8bbffdbbaccad36d4583 (diff)
downloadcpython-git-76961faaa0323580caac8068848c33b7aeec13ee.tar.gz
Issue #13757: Change os.fdlistdir() so that it duplicates the passed file
descriptor (instead of closing it).
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 07755b983a..f8c6baa083 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -455,20 +455,14 @@ class PosixTester(unittest.TestCase):
def test_fdlistdir(self):
f = posix.open(posix.getcwd(), posix.O_RDONLY)
self.addCleanup(posix.close, f)
- f1 = posix.dup(f)
self.assertEqual(
sorted(posix.listdir('.')),
- sorted(posix.fdlistdir(f1))
+ sorted(posix.fdlistdir(f))
)
- # Check the fd was closed by fdlistdir
- with self.assertRaises(OSError) as ctx:
- posix.close(f1)
- self.assertEqual(ctx.exception.errno, errno.EBADF)
# Check that the fd offset was reset (issue #13739)
- f2 = posix.dup(f)
self.assertEqual(
sorted(posix.listdir('.')),
- sorted(posix.fdlistdir(f2))
+ sorted(posix.fdlistdir(f))
)
def test_access(self):