Skip to content

Commit

Permalink
fix pypa#1419 PEP420: clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
silkentrance committed Aug 14, 2018
1 parent 43d8da9 commit 99f2363
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions setuptools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,17 +515,15 @@ def _parse_packages(self, value):
:param value:
:rtype: list
"""
find_directive = 'find:'
find_namespace_directive = 'find_namespace:'

findns = False
if not value.startswith(find_directive):
if value.startswith(find_namespace_directive):
if not PY3:
raise DistutilsOptionError('find_namespace directive is unsupported on Python < 3.3')
findns = True
else:
return self._parse_list(value)
find_directives = ['find:', 'find_namespace:']
trimmed_value = value.strip()

if not trimmed_value in find_directives:
return self._parse_list(value)

findns = trimmed_value == find_directives[1]
if findns and not PY3:
raise DistutilsOptionError('find_namespace: directive is unsupported on Python < 3.3')

# Read function arguments from a dedicated section.
find_kwargs = self.parse_section_packages__find(
Expand Down

0 comments on commit 99f2363

Please sign in to comment.