Commit f19e5732 authored by Jason R. Coombs's avatar Jason R. Coombs

Use rpartition for simplicity

parent d7c802d0
...@@ -112,9 +112,8 @@ def check_nsp(dist, attr, value): ...@@ -112,9 +112,8 @@ def check_nsp(dist, attr, value):
"Distribution contains no modules or packages for " + "Distribution contains no modules or packages for " +
"namespace package %r" % nsp "namespace package %r" % nsp
) )
if '.' in nsp: parent, sep, child = nsp.rpartition('.')
parent = '.'.join(nsp.split('.')[:-1]) if parent and parent not in value:
if parent not in value:
distutils.log.warn( distutils.log.warn(
"WARNING: %r is declared as a package namespace, but %r" "WARNING: %r is declared as a package namespace, but %r"
" is not: please correct this in setup.py", nsp, parent " is not: please correct this in setup.py", nsp, parent
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment