From f4bf14771546b9b4981f0a18f556650336a4c0c4 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 22 Dec 2024 20:41:59 -0500 Subject: [PATCH] Match current python's keywords in `axdebug.codecontainer` (#2439) --- com/win32comext/axdebug/codecontainer.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/com/win32comext/axdebug/codecontainer.py b/com/win32comext/axdebug/codecontainer.py index 8546d0c03e..fdcaf6b64d 100644 --- a/com/win32comext/axdebug/codecontainer.py +++ b/com/win32comext/axdebug/codecontainer.py @@ -9,6 +9,7 @@ import os import sys import tokenize +from keyword import kwlist from typing import Any import win32api @@ -17,13 +18,13 @@ from win32com.axdebug.util import _wrap from win32com.server.exception import COMException -_keywords = {} # set of Python keywords -for name in """ - and assert break class continue def del elif else except exec - finally for from global if import in is lambda not - or pass print raise return try while - """.split(): - _keywords[name] = 1 +_keywords = { + _keyword + for _keyword in kwlist + # Avoids including True/False/None + if _keyword.islower() +} +"""set of Python keywords""" class SourceCodeContainer: