Skip to content

Commit

Permalink
Do not error if use_2to3 is set to a false value
Browse files Browse the repository at this point in the history
  • Loading branch information
plumdog committed Sep 7, 2021
1 parent b254ea7 commit 646aa95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ distutils.setup_keywords =
dependency_links = setuptools.dist:assert_string_list
test_loader = setuptools.dist:check_importable
test_runner = setuptools.dist:check_importable
use_2to3 = setuptools.dist:invalid
use_2to3 = setuptools.dist:invalid_ignored_if_false
egg_info.writers =
PKG-INFO = setuptools.command.egg_info:write_pkg_info
requires.txt = setuptools.command.egg_info:write_requirements
Expand Down
7 changes: 5 additions & 2 deletions setuptools/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,11 @@ def assert_bool(dist, attr, value):
raise DistutilsSetupError(tmpl.format(attr=attr, value=value))


def invalid(dist, attr, value):
raise DistutilsSetupError(f"{attr} is invalid.")
def invalid_ignored_if_false(dist, attr, value):
if not value:
warnings.warn("{attr} is ignored")
return
raise DistutilsSetupError(f"{attr} is invalid if it is set to a true value.")


def check_requirements(dist, attr, value):
Expand Down

0 comments on commit 646aa95

Please sign in to comment.