From 6c38af7c41d604ab2b11df0cd8e7c4afa86dbfa5 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Mon, 9 Oct 2023 13:40:09 -0700 Subject: [PATCH] Fix cpplint sre_compile deprecation warning (#262) sre_compile is an implementation detail of the re module that moved in Python 3.11. --- wpiformat/wpiformat/cpplint.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wpiformat/wpiformat/cpplint.py b/wpiformat/wpiformat/cpplint.py index f5239cf..53dee70 100644 --- a/wpiformat/wpiformat/cpplint.py +++ b/wpiformat/wpiformat/cpplint.py @@ -49,10 +49,14 @@ import math # for log import os import regex -import sre_compile import string import sys +try: + import re._compiler as sre_compile +except ImportError: # Python < 3.11 + import sre_compile + # if empty, use defaults _header_regex = regex.compile("a^")