mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
build(clint): fix deprecation and linter warnings
`sre_compile` is deprecated in python 11, and gives warning when is used.
This commit is contained in:
parent
efae71819a
commit
c98ef2d7c6
@ -42,7 +42,6 @@ import copy
|
|||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sre_compile
|
|
||||||
import string
|
import string
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
@ -308,14 +307,14 @@ def Match(pattern, s):
|
|||||||
# performance reasons; factoring it out into a separate function turns out
|
# performance reasons; factoring it out into a separate function turns out
|
||||||
# to be noticeably expensive.
|
# to be noticeably expensive.
|
||||||
if pattern not in _regexp_compile_cache:
|
if pattern not in _regexp_compile_cache:
|
||||||
_regexp_compile_cache[pattern] = sre_compile.compile(pattern)
|
_regexp_compile_cache[pattern] = re.compile(pattern)
|
||||||
return _regexp_compile_cache[pattern].match(s)
|
return _regexp_compile_cache[pattern].match(s)
|
||||||
|
|
||||||
|
|
||||||
def Search(pattern, s):
|
def Search(pattern, s):
|
||||||
"""Searches the string for the pattern, caching the compiled regexp."""
|
"""Searches the string for the pattern, caching the compiled regexp."""
|
||||||
if pattern not in _regexp_compile_cache:
|
if pattern not in _regexp_compile_cache:
|
||||||
_regexp_compile_cache[pattern] = sre_compile.compile(pattern)
|
_regexp_compile_cache[pattern] = re.compile(pattern)
|
||||||
return _regexp_compile_cache[pattern].search(s)
|
return _regexp_compile_cache[pattern].search(s)
|
||||||
|
|
||||||
|
|
||||||
@ -2810,6 +2809,8 @@ def ParseArguments(args):
|
|||||||
Returns:
|
Returns:
|
||||||
The list of filenames to lint.
|
The list of filenames to lint.
|
||||||
"""
|
"""
|
||||||
|
opts = []
|
||||||
|
filenames = []
|
||||||
try:
|
try:
|
||||||
(opts, filenames) = getopt.getopt(args, '', ['help',
|
(opts, filenames) = getopt.getopt(args, '', ['help',
|
||||||
'output=',
|
'output=',
|
||||||
|
Loading…
Reference in New Issue
Block a user