[edk2] [PATCH v2 09/20] BaseTools: Remove types.TypeType

Gary Lin posted 20 patches 6 years, 10 months ago
There is a newer version of this series
[edk2] [PATCH v2 09/20] BaseTools: Remove types.TypeType
Posted by Gary Lin 6 years, 10 months ago
"types.TypeType" is now an alias of the built-in "type" and is not
compatible with python 3.

Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Gary Lin <glin@suse.com>
---
 BaseTools/Tests/TestTools.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/BaseTools/Tests/TestTools.py b/BaseTools/Tests/TestTools.py
index 1202289616ee..1cf2ce13be2b 100644
--- a/BaseTools/Tests/TestTools.py
+++ b/BaseTools/Tests/TestTools.py
@@ -24,7 +24,6 @@ import random
 import shutil
 import subprocess
 import sys
-import types
 import unittest
 
 TestsDir = os.path.realpath(os.path.split(sys.argv[0])[0])
@@ -43,7 +42,7 @@ if PythonSourceDir not in sys.path:
 def MakeTheTestSuite(localItems):
     tests = []
     for name, item in localItems.iteritems():
-        if isinstance(item, types.TypeType):
+        if isinstance(item, type):
             if issubclass(item, unittest.TestCase):
                 tests.append(unittest.TestLoader().loadTestsFromTestCase(item))
             elif issubclass(item, unittest.TestSuite):
-- 
2.16.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel