Skip to content

Commit db96c83

Browse files
Use get_submission for one submission
1 parent 1ba646d commit db96c83

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/judge0/api.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,15 @@ def wait(
7575
}
7676

7777
while len(submissions_to_check) > 0 and not retry_mechanism.is_done():
78-
client.get_submissions(submissions_to_check.values())
78+
# We differentiate between getting a single submission and multiple
79+
# submissions to be consistent with the API, even though the API
80+
# allows to get single submission with the same endpoint as for getting
81+
# the multiple submissions.
82+
if len(submissions_to_check) == 1:
83+
client.get_submission(*submissions_to_check.values())
84+
else:
85+
client.get_submissions(submissions_to_check.values())
86+
7987
for token in list(submissions_to_check):
8088
submission = submissions_to_check[token]
8189
if submission.is_done():

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy