def build_whl(source, dest):
    tempdir = None
    olddir = os.path.abspath(os.curdir)
    try:
        tempdir = tempfile.mkdtemp(prefix='pyshop')
        # FIXME: .zip is not supported yet
        if source.endswith('.zip'):
            with zipfile.ZipFile(source, 'r') as arch:
                if [file for file in arch.namelist() if file in '..']:
                    raise RuntimeError('Archive is not safe')
                arch.extractall(tempdir)
        else:
            arch = tarfile.open(source)
            try:
                if [file for file in arch.getnames() if '..' in file]:
                    raise RuntimeError('Archive is not safe')
                arch.extractall(tempdir)
            finally:
                arch.close()

        os.chdir(os.path.join(tempdir, os.listdir(tempdir)[0]))
        os.system('python setup.py bdist_wheel')
        distdir = os.path.join(tempdir, os.listdir(tempdir)[0], 'dist')
        wheel = os.path.join(distdir, os.listdir(distdir)[0])
        # XXX
        # As we already have serve a filename, we must respect it
        # if the archive is intended for build for a specific platform,
        # like Linux-x86_64 it will be renamed to "any" but only works
        # for  Linux-x86_64.
        shutil.move(wheel, dest)
    finally:
        os.chdir(olddir)
        if tempdir:
            shutil.rmtree(tempdir)
dataset/ETHPy150Open mardiros/pyshop/pyshop/helpers/download.py/build_whl/swapped operands of `in`