diegoferigo / cmake-build-extension

Setuptools extension to build and package CMake projects
https://pypi.org/project/cmake-build-extension/
MIT License
67 stars 16 forks source link

Move reference to unbound local variable into loop #48

Closed carlsondc-ceva closed 1 year ago

carlsondc-ceva commented 1 year ago

Got this error on a windows VS build. Moving this into the loop over cmake_extensions avoids the unbound local error and also handles the case where cmake_generator is None.

      File "C:\Users\douglasc\AppData\Local\Temp\pip-build-env-sm21v1a3\overlay\Lib\site-packages\cmake_build_extension\build_extension.py", line 92, in run
          if ext.cmake_generator.lower() == "ninja" and shutil.which("ninja") is None:
      UnboundLocalError: local variable 'ext' referenced before assignment
      [end of output]