Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7978e10

Browse files
committed
Issue #23883: Missing fileinput.__all__ APIs; patch by Mauro SM Rodrigues
1 parent 7b3a82f commit 7978e10

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

Lib/fileinput.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
import sys, os
8383

8484
__all__ = ["input", "close", "nextfile", "filename", "lineno", "filelineno",
85-
"isfirstline", "isstdin", "FileInput"]
85+
"fileno", "isfirstline", "isstdin", "FileInput", "hook_compressed",
86+
"hook_encoded"]
8687

8788
_state = None
8889

Lib/test/test_fileinput.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
from test.support import verbose, TESTFN, run_unittest, check_warnings
2626
from test.support import unlink as safe_unlink
27+
from test import support
2728
from unittest import mock
2829

2930

@@ -913,5 +914,12 @@ def check(mode, expected_lines):
913914
check('rb', ['A\n', 'B\r\n', 'C\r', 'D\u20ac'])
914915

915916

917+
class MiscTest(unittest.TestCase):
918+
919+
def test_all(self):
920+
blacklist = {'DEFAULT_BUFSIZE'}
921+
support.check__all__(self, fileinput, blacklist=blacklist)
922+
923+
916924
if __name__ == "__main__":
917925
unittest.main()

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ Mark Roddy
12191219
Kevin Rodgers
12201220
Sean Rodman
12211221
Giampaolo Rodola
1222+
Mauro S. M. Rodrigues
12221223
Elson Rodriguez
12231224
Adi Roiban
12241225
Luis Rojas

0 commit comments

Comments
 (0)