From 2337d2e4ea17b9db30b1986e7af813919532d0ba Mon Sep 17 00:00:00 2001 From: Maksym Hazevych Date: Thu, 5 Feb 2026 02:37:46 +0200 Subject: [PATCH 1/3] Fix import of 'importlib' Fixes the script to actually run. Otherwise, this error was thrown (and ignored): AttributeError: module 'importlib' has no attribute 'util' --- src/termux-create-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/termux-create-package b/src/termux-create-package index 9343d9f..e18c89c 100755 --- a/src/termux-create-package +++ b/src/termux-create-package @@ -34,7 +34,7 @@ import time import traceback import unicodedata -import importlib +import importlib.util yaml_supported = False try: if importlib.util.find_spec("ruamel.yaml") is not None: From 64dd695abc70da330d02c4020aa7c5bd6ccf9094 Mon Sep 17 00:00:00 2001 From: Maksym Hazevych Date: Thu, 5 Feb 2026 02:55:20 +0200 Subject: [PATCH 2/3] Fix 'importlib' import in test files --- tests/tests_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests_main.py b/tests/tests_main.py index a5eeafb..f114db5 100644 --- a/tests/tests_main.py +++ b/tests/tests_main.py @@ -9,7 +9,7 @@ """ import os -import importlib +import importlib.util import sys From 4ee8ccb710d7075d0691e608b14105a93e61197c Mon Sep 17 00:00:00 2001 From: Maksym Hazevych Date: Thu, 5 Feb 2026 02:49:09 +0200 Subject: [PATCH 3/3] Fix "Bitwise inversion '~' on bool is deprecated" warning Important to do since it will be removed in Python 3.16 --- src/termux-create-package | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/termux-create-package b/src/termux-create-package index e18c89c..483e98a 100755 --- a/src/termux-create-package +++ b/src/termux-create-package @@ -1574,9 +1574,9 @@ def get_effective_mode(current_mode, symbolic, file_type=None): ("o" in clazz and "t" in perm and stat.S_ISVTX) else: new_mode = new_mode & \ - ~("u" in clazz and "s" in perm and stat.S_ISUID) & \ - ~("g" in clazz and "s" in perm and stat.S_ISGID) & \ - ~("o" in clazz and "t" in perm and stat.S_ISVTX) + ~int("u" in clazz and "s" in perm and stat.S_ISUID) & \ + ~int("g" in clazz and "s" in perm and stat.S_ISGID) & \ + ~int("o" in clazz and "t" in perm and stat.S_ISVTX) return new_mode