From 172b8d5dac7551061e325ffd8780fc8cc568fe67 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 23 Nov 2019 15:47:20 -0800 Subject: [PATCH] Fix non-ascii number codes in !pep --- bot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 58cb723..4ed32b2 100644 --- a/bot.py +++ b/bot.py @@ -298,9 +298,8 @@ def cmd_uptime(match: Match[str]) -> Response: @handle_message(r'!pep[ ]?(?P\d{1,4})') def cmd_pep(match: Match[str]) -> Response: *_, number = match.groups() - return MessageResponse( - match, f'https://www.python.org/dev/peps/pep-{int(number).zfill(4)}/', - ) + n = str(int(number)).zfill(4) + return MessageResponse(match, f'https://www.python.org/dev/peps/pep-{n}/') COMMAND_RE = re.compile(r'!\w+')