summaryrefslogtreecommitdiff
path: root/setuptools
diff options
context:
space:
mode:
authorDeniz Taneli <7292227+dtaneli@users.noreply.github.com>2018-11-10 19:55:12 +0000
committerDeniz Taneli <7292227+dtaneli@users.noreply.github.com>2018-11-10 19:55:12 +0000
commit1047052e341d69c799e26ff889359e101c5e0499 (patch)
treefa01e205da40606b625fbecc7cb4e04c3856ce50 /setuptools
parent4e4efa77722cc2e99171a2396252a4ddc98450e3 (diff)
downloadpython-setuptools-git-1047052e341d69c799e26ff889359e101c5e0499.tar.gz
Address review comments
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/command/sdist.py12
-rw-r--r--setuptools/tests/test_egg_info.py2
2 files changed, 8 insertions, 6 deletions
diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py
index 347f8817..dc253981 100644
--- a/setuptools/command/sdist.py
+++ b/setuptools/command/sdist.py
@@ -6,7 +6,6 @@ import io
import contextlib
from setuptools.extern import six
-from setuptools.extern.six.moves import configparser
from .py36compat import sdist_add_defaults
@@ -206,11 +205,12 @@ class sdist(sdist_add_defaults, orig.sdist):
"""
opts = self.distribution.get_option_dict('metadata')
- try:
- # ignore the source of the value
- _, license_file = opts.get('license_file')
- except TypeError:
- log.debug("'license_file' attribute is not defined")
+
+ # ignore the source of the value
+ _, license_file = opts.get('license_file', (None, None))
+
+ if license_file is None:
+ log.debug("'license_file' option was not specified")
return
if not os.path.exists(license_file):
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 76c31ada..04a17308 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -529,8 +529,10 @@ class TestEggInfo:
env=environ,
)
egg_info_dir = os.path.join('.', 'foo.egg-info')
+
with open(os.path.join(egg_info_dir, 'SOURCES.txt')) as sources_file:
sources_text = sources_file.read()
+
if license_in_sources:
assert 'LICENSE' in sources_text
else: