Skip to content

Commit 42d34a1

Browse files
Apply ruff/Pylint rule PLR1722
PLR1722 Use `sys.exit()` instead of `exit`
1 parent 0a14f58 commit 42d34a1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/bench/echoserver.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pathlib
66
import socket
77
import ssl
8+
import sys
89

910

1011
PRINT = 0
@@ -159,11 +160,11 @@ async def print_debug(loop):
159160
if args.streams:
160161
if args.proto:
161162
print('cannot use --stream and --proto simultaneously')
162-
exit(1)
163+
sys.exit(1)
163164

164165
if args.buffered:
165166
print('cannot use --stream and --buffered simultaneously')
166-
exit(1)
167+
sys.exit(1)
167168

168169
print('using asyncio/streams')
169170
if unix:
@@ -178,7 +179,7 @@ async def print_debug(loop):
178179
elif args.proto:
179180
if args.streams:
180181
print('cannot use --stream and --proto simultaneously')
181-
exit(1)
182+
sys.exit(1)
182183

183184
if args.buffered:
184185
print('using buffered protocol')
@@ -197,7 +198,7 @@ async def print_debug(loop):
197198
else:
198199
if args.ssl:
199200
print('cannot use SSL for loop.sock_* methods')
200-
exit(1)
201+
sys.exit(1)
201202

202203
print('using sock_recv/sock_sendall')
203204
loop.create_task(echo_server(loop, addr, unix))

0 commit comments

Comments
 (0)