From eb225d58fa8dc0ec321757c4166e8e7a6571e44b Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 26 Aug 2022 09:53:30 +0200 Subject: [PATCH] Use _test function instead of isfile when testing egg modules issue11668 review427621004 --- trytond/tools/misc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trytond/tools/misc.py b/trytond/tools/misc.py index 26103e9778..858ba23d1c 100644 --- a/trytond/tools/misc.py +++ b/trytond/tools/misc.py @@ -52,16 +52,16 @@ def find_path(name, subdir='modules', _test=os.path.isfile): *epoint.module_name.split('.')[:-1]) mod_path = os.path.abspath(mod_path) egg_name = secure_join(mod_path, name) - if not os.path.isfile(egg_name): + if not _test(egg_name): # Find module in path for path in sys.path: mod_path = os.path.join(path, *epoint.module_name.split('.')[:-1]) mod_path = os.path.abspath(mod_path) egg_name = secure_join(mod_path, name) - if os.path.isfile(egg_name): + if _test(egg_name): break - if not os.path.isfile(egg_name): + if not _test(egg_name): # When testing modules from setuptools location is the # module directory egg_name = secure_join(