From: Michal Siska <94260368+515k4@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:51:56 +0000 (+0100) Subject: Removed distutils import from autoload/black.vim (#2607) (#2610) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/78317a4cfb2cc7958ebd553ff6d7cc1aff0d8296?ds=inline;hp=3cb010ec8ec02392dee5073b74e6eff80030c5f0 Removed distutils import from autoload/black.vim (#2607) (#2610) --- diff --git a/CHANGES.md b/CHANGES.md index 0d409d7..c565fbe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,10 @@ - Add support for parenthesized with (#2586) - Declare support for Python 3.10 for running Black (#2562) +### Integrations + +- Fixed vim plugin with Python 3.10 by removing deprecated distutils import (#2610) + ## 21.10b0 ### _Black_ diff --git a/autoload/black.vim b/autoload/black.vim index 9ff5c23..6c3bbfe 100644 --- a/autoload/black.vim +++ b/autoload/black.vim @@ -3,8 +3,13 @@ import collections import os import sys import vim -from distutils.util import strtobool +def strtobool(text): + if text.lower() in ['y', 'yes', 't', 'true' 'on', '1']: + return True + if text.lower() in ['n', 'no', 'f', 'false' 'off', '0']: + return False + raise ValueError(f"{text} is not convertable to boolean") class Flag(collections.namedtuple("FlagBase", "name, cast")): @property