Browse Source

tests: Replace use of deprecated imp module in test_imports

rdb 3 years ago
parent
commit
4c58eb3382
1 changed files with 2 additions and 4 deletions
  1. 2 4
      tests/test_imports.py

+ 2 - 4
tests/test_imports.py

@@ -9,14 +9,12 @@ import pytest
 
 
 def test_imports_panda3d():
-    import imp, importlib, os
+    import importlib, os
     import panda3d
     dir = os.path.dirname(panda3d.__file__)
 
     # Iterate over the things in the panda3d package that look like modules.
-    extensions = set()
-    for suffix in imp.get_suffixes():
-        extensions.add(suffix[0])
+    extensions = set(importlib.machinery.all_suffixes())
 
     for basename in os.listdir(dir):
         if basename.startswith('lib'):