]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Fix python3 string check 1981/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 25 Mar 2022 13:38:28 +0000 (09:38 -0400)
committerGitHub <noreply@github.com>
Fri, 25 Mar 2022 13:38:28 +0000 (09:38 -0400)
Co-authored-by: Kefu Chai <tchaikov@gmail.com>
scripts/build_utils.sh

index 7d53a5927f6297619b72e5de12c150d15b0bfb42..70802b0f18c786bd79d423ead7a6aa207761cc72 100644 (file)
@@ -564,7 +564,7 @@ setup_pbuilder() {
     # ensure that the tgz is valid, otherwise remove it so that it can be recreated
     # again
     pbuild_tar="$basedir/$DIST.tgz"
-    is_not_tar=`python -c "exec 'try: import tarfile;print int(not int(tarfile.is_tarfile(\"$pbuild_tar\")))\nexcept IOError: print 1'"`
+    is_not_tar=`python3 -c $'try: import tarfile;print(int(not int(tarfile.is_tarfile(\"$pbuild_tar\"))))\nexcept IOError: print(1)'`
     file_size_kb=`test -f $pbuild_tar && du -k "$pbuild_tar" | cut -f1 || echo 0`
 
     if [ "$is_not_tar" = "1" ]; then