Fix universal extraction in non-universal wheel

The pypi-extract-universal.py would raise ConfigParser.NoOptionError
when inspecting a setup.cfg with a wheel section but no universal
option. Guard against this by actually testing whether the option is
there rather than merely whether the section exists.

Change-Id: I7a907464e5b1dc211c7e4c4c2f3e6375b7a6085d
This commit is contained in:
Jeremy Stanley
2015-07-01 16:35:33 +00:00
parent 256f1ab233
commit f21796d28e

View File

@@ -20,7 +20,7 @@ universal = False
setup_cfg = ConfigParser.SafeConfigParser()
setup_cfg.read("setup.cfg")
if setup_cfg.has_section("wheel"):
if setup_cfg.has_option("wheel", "universal"):
universal = setup_cfg.getboolean("wheel", "universal")
if universal:
print("py2.py3")