From fb12b0a498868b846c3c74f836e89bb8be001f41 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Mon, 15 May 2023 10:13:39 +0200 Subject: [PATCH] Fix snap damage "self" conflicting w python keyword --- scripts/generate_messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate_messages.py b/scripts/generate_messages.py index f901e00..3880177 100755 --- a/scripts/generate_messages.py +++ b/scripts/generate_messages.py @@ -209,8 +209,8 @@ f""" def fix_name_conflict(name: str) -> str: # https://peps.python.org/pep-0008/#descriptive-naming-styles - if name == 'pass': - return 'pass_' + if name in ('pass', 'self'): + return f'{name}_' return name def name_to_camel(name_list: list[str]) -> str: