From 4d91f0381c7c2f2d1d2f7911ce7e70024bd3a016 Mon Sep 17 00:00:00 2001 From: Drew Young Date: Tue, 21 Feb 2023 13:30:41 -0500 Subject: [PATCH] Load .pyc modules --- thingsboard_gateway/tb_utility/tb_loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thingsboard_gateway/tb_utility/tb_loader.py b/thingsboard_gateway/tb_utility/tb_loader.py index 3359a89cf..7ff1f1b1d 100644 --- a/thingsboard_gateway/tb_utility/tb_loader.py +++ b/thingsboard_gateway/tb_utility/tb_loader.py @@ -53,7 +53,7 @@ def import_module(extension_type, module_name): current_extension_path = current_path + path.sep + extension_type if path.exists(current_extension_path): for file in listdir(current_extension_path): - if not file.startswith('__') and file.endswith('.py'): + if not file.startswith('__') and (file.endswith('.py') or file.endswith('.pyc')): try: module_spec = spec_from_file_location(module_name, current_extension_path + path.sep + file) log.debug(module_spec)