Skip to content

Commit 49524bb

Browse files
committed
Fix behavior of login-service --check
1 parent 558a3c2 commit 49524bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

onlinejudge_api/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,10 @@ def main(args: Optional[List[str]] = None, *, debug: bool = False) -> Dict[str,
263263
if parsed.subcommand == 'login-service':
264264
if parsed.password is not None:
265265
parser.error("don't use --password. use $PASSWORD")
266-
parsed.password = os.environ.get('PASSWORD')
267-
if not parsed.check and not debug:
268-
del os.environ['PASSWORD']
266+
if not parsed.check:
267+
parsed.password = os.environ.get('PASSWORD')
268+
if not debug:
269+
del os.environ['PASSWORD']
269270

270271
try:
271272
with utils.with_cookiejar(session, path=parsed.cookie) as session:

0 commit comments

Comments
 (0)