diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-05-19 20:59:55 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-05-19 20:59:55 -0400 |
commit | 1023e656f94124753e913bc070d82710a804b751 (patch) | |
tree | 6a8846a3328c61e4a5c07c3434c7c47b451ee18f | |
parent | a16377e838c1b39e3464dbcb50a09b24253ac60f (diff) | |
download | python-setuptools-git-1023e656f94124753e913bc070d82710a804b751.tar.gz |
When discovering commands and distribution does not yet exist, return the empty list.
-rw-r--r-- | setuptools/dist.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index bab6b444..ba810d1a 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -652,8 +652,12 @@ class Distribution(_Distribution): return underscore_opt def _setuptools_commands(self): - dist = pkg_resources.get_distribution('setuptools') - return list(dist.get_entry_map('distutils.commands')) + try: + dist = pkg_resources.get_distribution('setuptools') + return list(dist.get_entry_map('distutils.commands')) + except pkg_resources.DistributionNotFound: + # during bootstrapping, distribution doesn't exist + return [] def make_option_lowercase(self, opt, section): if section != 'metadata' or opt.islower(): |