Skip to content

Commit 1e401d6

Browse files
committed
Stop using deprecated find_module method
This method has been removed in Python 3.12. Addressing: Traceback (most recent call last): File "/__w/content/content/./ctf/content_test_filtering.py", line 44, in <module> diff_structure = diff_analysis.analyse_file(file_record) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/__w/content/content/ctf/ctf/diff_analysis.py", line 40, in analyse_file module = importer.find_module(full_package_name).load_module( ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'FileFinder' object has no attribute 'find_module'
1 parent 61f8214 commit 1e401d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ctf/diff_analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def analyse_file(file_record):
3737
for importer, package_name, _ in pkgutil.iter_modules([path.dirname(__file__)
3838
+ "/analysis"]):
3939
full_package_name = "%s.%s" % ("ctf.analysis", package_name)
40-
module = importer.find_module(full_package_name).load_module(
41-
full_package_name)
40+
spec = importer.find_spec(full_package_name)
41+
module = spec.loader.load_module()
4242
analysis_modules.append(module)
4343

4444
# Get all classes with "is_valid" method

0 commit comments

Comments
 (0)