From f19b5d6ea6cf14d89844653953ec05683b995210 Mon Sep 17 00:00:00 2001 From: glubsy Date: Fri, 24 Jul 2020 03:12:40 +0200 Subject: [PATCH] Fix error in package script for (Arch) Linux * While packaging, the "build/help" and "build/locale" directories are not found. * Work around the issue with try/except statements. --- package.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/package.py b/package.py index be949bce..f89a5a60 100644 --- a/package.py +++ b/package.py @@ -43,8 +43,14 @@ def copy_files_to_package(destpath, packages, with_so): shutil.copy("run.py", op.join(destpath, "run.py")) extra_ignores = ["*.so"] if not with_so else None copy_packages(packages, destpath, extra_ignores=extra_ignores) - shutil.copytree(op.join("build", "help"), op.join(destpath, "help")) - shutil.copytree(op.join("build", "locale"), op.join(destpath, "locale")) + try: + shutil.copytree(op.join("build", "help"), op.join(destpath, "help")) + except Exception as e: + print(f"Warning: exception: {e}") + try: + shutil.copytree(op.join("build", "locale"), op.join(destpath, "locale")) + except Exception as e: + print(f"Warning: exception: {e}") compileall.compile_dir(destpath)