diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-04-26 18:25:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 18:25:07 +0200 |
commit | c98ef2d7c629708d626e602d221f053ef74d4e34 (patch) | |
tree | 1d33bade9ac3c8b8629ebba413accaf75760821f /src/clint.py | |
parent | efae71819a99b1cf9cce024b520b62bb455229f9 (diff) | |
download | rneovim-c98ef2d7c629708d626e602d221f053ef74d4e34.tar.gz rneovim-c98ef2d7c629708d626e602d221f053ef74d4e34.tar.bz2 rneovim-c98ef2d7c629708d626e602d221f053ef74d4e34.zip |
build(clint): fix deprecation and linter warnings
`sre_compile` is deprecated in python 11, and gives warning when is used.
Diffstat (limited to 'src/clint.py')
-rwxr-xr-x | src/clint.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/clint.py b/src/clint.py index 155f5f2ce5..a6649763c2 100755 --- a/src/clint.py +++ b/src/clint.py @@ -42,7 +42,6 @@ import copy import getopt import os import re -import sre_compile import string import sys import json @@ -308,14 +307,14 @@ def Match(pattern, s): # performance reasons; factoring it out into a separate function turns out # to be noticeably expensive. 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) def Search(pattern, s): """Searches the string for the pattern, caching the compiled regexp.""" 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) @@ -2810,6 +2809,8 @@ def ParseArguments(args): Returns: The list of filenames to lint. """ + opts = [] + filenames = [] try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', |