Skip to content

Commit

Permalink
kiwi_boxed_plugin: utils: fetch_files: improve progressbar import
Browse files Browse the repository at this point in the history
The progressbar2 module is installed on Debian-based systems as
"progressbar2", and can be imported as such, but if progressbar2 has been
installed from pip the module is called "progressbar". Adjust the import of
this module to first try importing "progressbar2", and if it fails, fall back
to "progressbar". This stops the tool from trying to import the old
progressbar module rather than the correct progressbar2 module.

Signed-off-by: Isaac True <[email protected]>
  • Loading branch information
IsaacJT committed Sep 19, 2023
1 parent 9238a64 commit cfdf5cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kiwi_boxed_plugin/utils/fetch_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
# along with kiwi-boxed-build. If not, see <http://www.gnu.org/licenses/>
#
import requests
import progressbar
try:
import progressbar2 as progressbar
except ImportError:
import progressbar
import requests.packages.urllib3


Expand Down

0 comments on commit cfdf5cf

Please sign in to comment.