Skip to content

Commit 84c46db

Browse files
committed
Check sys.flags.quiet prior to creating and showing banner
1 parent d515f7d commit 84c46db

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Lib/asyncio/__main__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ def run(self):
8686
global return_code
8787

8888
try:
89-
banner = (
90-
f'asyncio REPL {sys.version} on {sys.platform}\n'
91-
f'Use "await" directly instead of "asyncio.run()".\n'
92-
f'Type "help", "copyright", "credits" or "license" '
93-
f'for more information.\n'
94-
)
95-
96-
console.write(banner)
89+
if not sys.flags.quiet:
90+
banner = (
91+
f'asyncio REPL {sys.version} on {sys.platform}\n'
92+
f'Use "await" directly instead of "asyncio.run()".\n'
93+
f'Type "help", "copyright", "credits" or "license" '
94+
f'for more information.\n'
95+
)
96+
97+
console.write(banner)
9798

9899
if startup_path := os.getenv("PYTHONSTARTUP"):
99100
sys.audit("cpython.run_startup", startup_path)

0 commit comments

Comments
 (0)