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

Rely on iterable unpacking to extract one element from generator expression.

parent 2db2a8f3
......@@ -160,11 +160,11 @@ def build_wheel(wheel_directory, config_settings=None,
shutil.rmtree(wheel_directory)
shutil.copytree('dist', wheel_directory)
wheels = [f for f in os.listdir(wheel_directory)
if f.endswith('.whl')]
wheels = (f for f in os.listdir(wheel_directory)
if f.endswith('.whl'))
assert len(wheels) == 1
return wheels[0]
wheel, = wheels
return wheel
def build_sdist(sdist_directory, config_settings=None):
......@@ -175,8 +175,8 @@ def build_sdist(sdist_directory, config_settings=None):
["--dist-dir", sdist_directory]
_run_setup()
sdists = [f for f in os.listdir(sdist_directory)
if f.endswith('.tar.gz')]
sdists = (f for f in os.listdir(sdist_directory)
if f.endswith('.tar.gz'))
assert len(sdists) == 1
return sdists[0]
sdist, = sdists
return sdist
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