summaryrefslogtreecommitdiffstats
path: root/Lib/ast.py
diff options
context:
space:
mode:
authorSemyon Moroz <donbarbos@proton.me>2025-05-04 21:11:13 (GMT)
committerGitHub <noreply@github.com>2025-05-04 21:11:13 (GMT)
commit6ce60f1574af458b2883bdbe5ab8986fba5bef5a (patch)
tree6e1426bfb3083e69b36761355e167ab15ac9cb6e /Lib/ast.py
parent40be123499b32ff453d7a282522af71df91bedf9 (diff)
downloadcpython-6ce60f1574af458b2883bdbe5ab8986fba5bef5a.zip
cpython-6ce60f1574af458b2883bdbe5ab8986fba5bef5a.tar.gz
cpython-6ce60f1574af458b2883bdbe5ab8986fba5bef5a.tar.bz2
gh-131178: Add tests for `ast` command-line interface (#133329)
Co-authored-by: sobolevn <mail@sobolevn.me>
Diffstat (limited to 'Lib/ast.py')
-rw-r--r--Lib/ast.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ast.py b/Lib/ast.py
index aa788e6..af4fe8f 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -626,7 +626,7 @@ def unparse(ast_obj):
return unparser.visit(ast_obj)
-def main():
+def main(args=None):
import argparse
import sys
@@ -643,7 +643,7 @@ def main():
'column offsets')
parser.add_argument('-i', '--indent', type=int, default=3,
help='indentation of nodes (number of spaces)')
- args = parser.parse_args()
+ args = parser.parse_args(args)
if args.infile == '-':
name = '<stdin>'