8000 gh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825) · python/cpython@e88ebc1 · GitHub
[go: up one dir, main page]

Skip to content

Commit e88ebc1

Browse files
gh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825)
Since 2f3941d this function returns the response string, rather than nothing.
1 parent 26800cf commit e88ebc1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Doc/library/ftplib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ FTP objects
232232
.. method:: FTP.voidcmd(cmd)
233233

234234
Send a simple command string to the server and handle the response. Return
235-
nothing if a response code corresponding to success (codes in the range
236-
200--299) is received. Raise :exc:`error_reply` otherwise.
235+
the response string if the response code corresponds to success (codes in
236+
the range 200--299). Raise :exc:`error_reply` otherwise.
237237

238238
.. audit-event:: ftplib.sendcmd self,cmd ftplib.FTP.voidcmd
239239

Lib/test/test_ftplib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ def test_set_pasv(self):
543543
self.assertFalse(self.client.passiveserver)
544544

545545
def test_voidcmd(self):
546-
self.client.voidcmd('echo 200')
547-
self.client.voidcmd('echo 299')
546+
self.assertEqual(self.client.voidcmd('echo 200'), '200')
547+
self.assertEqual(self.client.voidcmd('echo 299'), '299')
548548
self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 199')
549549
self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 300')
550550

0 commit comments

Comments
 (0)
0