Skip to content

Commit 097cfff

Browse files
authored
Merge pull request #46 from wimglenn/part-1-2
make _submit accept part 1 and part 2 as aliases for part a and part b
2 parents b1ab3e6 + d06ff24 commit 097cfff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aocd/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ def _submit(self, value, part, reopen=True, quiet=False):
258258
if value in {u"", b"", None, b"None", u"None"}:
259259
raise AocdError("cowardly refusing to submit non-answer: {!r}".format(value))
260260
value = str(value)
261-
if part not in {"A", "B", "a", "b"}:
261+
part = str(part).replace("1", "a").replace("2", "b").lower()
262+
if part not in {"a", "b"}:
262263
raise AocdError('part must be "a" or "b"')
263-
part = part.lower()
264264
bad_guesses = getattr(self, "incorrect_answers_" + part)
265265
if value in bad_guesses:
266266
if not quiet:

0 commit comments

Comments
 (0)