diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-10-19 14:02:08 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-10-19 14:02:08 -0400 |
commit | f19e5732da07d22ea0d7c7a64ba7e736ba2d1a52 (patch) | |
tree | 4ca9653e5513b53534c227220f62bdda14f9d545 | |
parent | d7c802d072989f6543f584fa6dfdd57b140ca43e (diff) | |
download | external_python_setuptools-f19e5732da07d22ea0d7c7a64ba7e736ba2d1a52.tar.gz external_python_setuptools-f19e5732da07d22ea0d7c7a64ba7e736ba2d1a52.tar.bz2 external_python_setuptools-f19e5732da07d22ea0d7c7a64ba7e736ba2d1a52.zip |
Use rpartition for simplicity
-rw-r--r-- | setuptools/dist.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 367c26ea..a3099fcd 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -112,9 +112,8 @@ def check_nsp(dist, attr, value): "Distribution contains no modules or packages for " + "namespace package %r" % nsp ) - if '.' in nsp: - parent = '.'.join(nsp.split('.')[:-1]) - if parent not in value: + parent, sep, child = nsp.rpartition('.') + if parent and parent not in value: distutils.log.warn( "WARNING: %r is declared as a package namespace, but %r" " is not: please correct this in setup.py", nsp, parent |