Skip to content

Commit e64847f

Browse files
Rename to *exclude-docstrings*
1 parent 6d62ea4 commit e64847f

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Lib/test/test_tools/test_i18n.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,8 @@ def extract_from_snapshots():
589589
'messages.py': (),
590590
'fileloc.py': ('--docstrings',),
591591
'docstrings.py': ('--docstrings',),
592-
('docstrings.py', 'skipdocstrings.py', 'docstrings.pot'): ('--docstrings', f'--no-docstrings={DATA_DIR}{os.path.sep}skipdocstrings.txt'),
592+
('docstrings.py', 'skipdocstrings.py', 'docstrings.pot'): ('--docstrings',
593+
f'--exclude-docstrings={DATA_DIR}{os.path.sep}skipdocstrings.txt'),
593594
'comments.py': ('--add-comments=i18n:',),
594595
'custom_keywords.py': ('--keyword=foo', '--keyword=nfoo:1,2',
595596
'--keyword=pfoo:1c,2',

Misc/NEWS.d/next/Library/2025-04-26-19-26-00.gh-issue-130197.sjdhsja.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix and test the ``--exclude-docstrings`` option in :program:`pygettext`.
2+
Note: the option was also renamed from ``--no-docstrings`` for clarity.

Tools/i18n/pygettext.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
appear on a line by itself in the file.
132132
133133
-X filename
134-
--no-docstrings=filename
134+
--exclude-docstrings=filename
135135
Specify a file that contains a list of files (one per line) that
136136
should not have their docstrings extracted. This is only useful in
137137
conjunction with the -D option above.
@@ -692,7 +692,7 @@ def main():
692692
'help', 'keyword=', 'no-default-keywords',
693693
'add-location', 'no-location', 'output=', 'output-dir=',
694694
'style=', 'verbose', 'version', 'width=', 'exclude-file=',
695-
'docstrings', 'no-docstrings=',
695+
'docstrings', 'exclude-docstrings=',
696696
])
697697
except getopt.error as msg:
698698
usage(1, msg)
@@ -766,7 +766,7 @@ class Options:
766766
usage(1, f'--width argument must be an integer: {arg}')
767767
elif opt in ('-x', '--exclude-file'):
768768
options.excludefilename = arg
769-
elif opt in ('-X', '--no-docstrings'):
769+
elif opt in ('-X', '--exclude-docstrings'):
770770
with open(arg, 'r') as nodocstrings_file:
771771
for line in nodocstrings_file:
772772
filename = os.path.basename(line.strip())

0 commit comments

Comments
 (0)