Skip to content

Commit 0b50914

Browse files
committed
Make sure user code ends with a new line, fixed laike9m#63
1 parent 55d5622 commit 0b50914

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

views/challenge.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def get_challenge(self, key: ChallengeKey) -> Challenge:
7373

7474
def run_challenge(self, key: ChallengeKey, user_code: str) -> TypeCheckResult:
7575
challenge = self.get_challenge(key)
76-
return self._type_check_with_pyright(user_code, challenge.test_code)
76+
# Make sure user code ends with a new line to avoid issue #63.
77+
return self._type_check_with_pyright(user_code + "\n", challenge.test_code)
7778

7879
def get_random_challenge(self) -> dict[str, str]:
7980
level = random.choice(list(self.challenges_groupby_level.keys()))

0 commit comments

Comments
 (0)