GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.15] gh-157159: improve the tabnanny usage message (GH-157160) (#15… · python/cpython@cf312cf

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Lib
    • tabnanny.py
    • test
      • test_tabnanny.py
  • Misc/NEWS.d/next/Library
    • 2026-09-08-09-30-00.gh-issue-157159.tabNny.rst
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Lib/tabnanny.py‎

Copy file name to clipboardExpand all lines: Lib/tabnanny.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def main():
4747
if o == '-v':
4848
verbose = verbose + 1
4949
if not args:
50-
errprint("Usage:", sys.argv[0], "[-v] file_or_directory ...")
50+
errprint(f"Usage: {sys.executable} -m tabnanny [-v] file_or_directory ...")
5151
for arg in args:
5252
check(arg)
5353

Collapse file

‎Lib/test/test_tabnanny.py‎

Copy file name to clipboardExpand all lines: Lib/test/test_tabnanny.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
from unittest import TestCase, main, mock
88
import errno
99
import os
10+
import sys
1011
import tabnanny
1112
import tokenize
1213
import tempfile
1314
import textwrap
14-
from test.support import (captured_stderr, captured_stdout, script_helper,
15-
findfile)
15+
from test.support import captured_stderr, captured_stdout, script_helper
1616
from test.support.os_helper import unlink
1717

1818

@@ -328,8 +328,7 @@ def test_with_error_free_file(self):
328328

329329
def test_command_usage(self):
330330
"""Should display usage on no arguments."""
331-
path = findfile('tabnanny.py')
332-
stderr = f"Usage: {path} [-v] file_or_directory ..."
331+
stderr = f"Usage: {sys.executable} -m tabnanny [-v] file_or_directory ..."
333332
self.validate_cmd(stderr=stderr, expect_failure=True)
334333

335334
def test_quiet_flag(self):
Collapse file

‎Misc/NEWS.d/next/Library/2026-09-08-09-30-00.gh-issue-157159.tabNny.rst‎

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The usage message printed by ``python -m tabnanny`` when no arguments are
2+
given now suggests ``python -m`` instead of the source file.

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.