diff --git a/mycli/main.py b/mycli/main.py index 1eb98f6a..20e55558 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -1,5 +1,4 @@ from collections import defaultdict -from io import open import os import sys import shutil diff --git a/mycli/packages/special/iocommands.py b/mycli/packages/special/iocommands.py index f26445ea..603bf5ef 100644 --- a/mycli/packages/special/iocommands.py +++ b/mycli/packages/special/iocommands.py @@ -4,7 +4,6 @@ import logging import subprocess import shlex -from io import open from time import sleep import click diff --git a/mycli/sqlcompleter.py b/mycli/sqlcompleter.py index 16362899..34ed9e44 100644 --- a/mycli/sqlcompleter.py +++ b/mycli/sqlcompleter.py @@ -1,5 +1,5 @@ import logging -from re import compile, escape +import re from collections import Counter from prompt_toolkit.completion import Completer, Completion @@ -900,7 +900,7 @@ def __init__(self, smart_completion=True, supported_formats=(), keyword_casing=" self.reserved_words = set() for x in self.keywords: self.reserved_words.update(x.split()) - self.name_pattern = compile(r"^[_a-z][_a-z0-9\$]*$") + self.name_pattern = re.compile(r"^[_a-z][_a-z0-9\$]*$") self.special_commands = [] self.table_formats = supported_formats @@ -1075,8 +1075,8 @@ def find_matches(text, collection, start_only=False, fuzzy=True, casing=None): completions = [] if fuzzy: - regex = ".*?".join(map(escape, text)) - pat = compile("(%s)" % regex) + regex = ".*?".join(map(re.escape, text)) + pat = re.compile("(%s)" % regex) for item in collection: r = pat.search(item.lower()) if r: diff --git a/pyproject.toml b/pyproject.toml index 86936fe9..ce9ad9d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,7 +80,6 @@ ignore = [ 'E117', # over-indented 'W191', # tab-indentation # TODO - 'A004', # todo enableme import shadowing builtin 'PIE796', # todo enableme Enum contains duplicate value ]