]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112165: Fix typo in `__main__.py` (#112183)
authorTerry Jan Reedy <tjreedy@udel.edu>
Fri, 17 Nov 2023 01:05:16 +0000 (20:05 -0500)
committerGitHub <noreply@github.com>
Fri, 17 Nov 2023 01:05:16 +0000 (20:05 -0500)
Change '[2]' to '[1]' to get second argument.

Doc/library/__main__.rst

index 24a32b30bba673fd23da013faf9622dbd1601ad3..c999253f781b107aee2a5fbc6ccc74225269d7a7 100644 (file)
@@ -227,7 +227,7 @@ students::
     import sys
     from .student import search_students
 
-    student_name = sys.argv[2] if len(sys.argv) >= 2 else ''
+    student_name = sys.argv[1] if len(sys.argv) >= 2 else ''
     print(f'Found student: {search_students(student_name)}')
 
 Note that ``from .student import search_students`` is an example of a relative