File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed
Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 2525# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2626# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
28- import imp
29- import itertools
30- import os
31- import re
28+ import importlib .machinery
3229import sys
3330
3431from pathlib import Path
3532
3633from testrunner .local import statusfile
3734from testrunner .local import testsuite
38- from testrunner .local import utils
3935from testrunner .objects import testcase
4036from testrunner .outproc import base as outproc
4137from testrunner .outproc import test262
@@ -146,11 +142,12 @@ def _load_parse_test_record(self):
146142 root = TEST_262_TOOLS_ABS_PATH
147143 f = None
148144 try :
149- (f , pathname , description ) = imp .find_module ("parseTestRecord" , [root ])
150- module = imp .load_module ("parseTestRecord" , f , pathname , description )
145+ loader = importlib .machinery .SourceFileLoader (
146+ "parseTestRecord" , f"{ root } /parseTestRecord.py" )
147+ module = loader .load_module ()
151148 return module .parseTestRecord
152- except :
153- print ('Cannot load parseTestRecord' )
149+ except Exception as e :
150+ print (f 'Cannot load parseTestRecord: { e } ' )
154151 raise
155152 finally :
156153 if f :
Original file line number Diff line number Diff line change 2626# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
2828
29- import imp
29+ import importlib . machinery
3030import itertools
3131import os
3232
3333from contextlib import contextmanager
3434from pathlib import Path
3535
3636from . import statusfile
37- from . import utils
3837from .variants import ALL_VARIANTS , ALL_VARIANT_FLAGS
3938
4039
@@ -232,12 +231,13 @@ def merge(self, test_generator):
232231def _load_testsuite_module (name , root ):
233232 f = None
234233 try :
235- ( f , pathname , description ) = imp . find_module ( "testcfg" , [ root ])
236- yield imp . load_module ( name + "_testcfg" , f , pathname , description )
234+ yield importlib . machinery . SourceFileLoader (
235+ name + "_testcfg" , f" { root } /testcfg.py" ). load_module ( )
237236 finally :
238237 if f :
239238 f .close ()
240239
240+
241241class TestSuite (object ):
242242 @staticmethod
243243 def Load (ctx , root , test_config ):
You can’t perform that action at this time.
0 commit comments