From 90cf8c55cf8438fa8a6e2d55de25eabaeb9934a0 Mon Sep 17 00:00:00 2001 From: Evan Richardson Date: Fri, 22 Dec 2023 07:35:14 +0000 Subject: [PATCH] Update fimport.py --- Docker/src/python/tHome/util/fimport.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Docker/src/python/tHome/util/fimport.py b/Docker/src/python/tHome/util/fimport.py index c31e105..faf2047 100644 --- a/Docker/src/python/tHome/util/fimport.py +++ b/Docker/src/python/tHome/util/fimport.py @@ -3,8 +3,9 @@ # Arbitrary file importing utility. Does NOT modify sys.modules # #=========================================================================== -import importlib +#import importlib import os +import types def fimport( filePath ): # Read the file and compile the code. This will fail if the file @@ -19,7 +20,7 @@ def fimport( filePath ): rootName, ext = os.path.splitext( fileName ) # Create a new module and exec the code in it's context. - m = importlib.import_module( rootName ) + m = types.ModuleType( rootName ) m.__file__ = absPath exec(code, m.__dict__)