File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -435,7 +435,7 @@ def import_no_init(name):
435435 from importlib .machinery import PathFinder
436436 import importlib .util as iu
437437 parts = name .split ('.' )
438- spec = PathFinder .find_spec (parts [0 ])
438+ spec = PathFinder .find_spec (parts [0 ]) or iu . find_spec ( parts [ 0 ])
439439 path = Path (spec .origin )
440440 if len (parts )> 1 : path = path .parent .joinpath (* parts [1 :]).with_suffix ('.py' )
441441 spec = iu .spec_from_file_location (name , path )
Original file line number Diff line number Diff line change 14151415 " from importlib.machinery import PathFinder\n " ,
14161416 " import importlib.util as iu\n " ,
14171417 " parts = name.split('.')\n " ,
1418- " spec = PathFinder.find_spec(parts[0])\n " ,
1418+ " spec = PathFinder.find_spec(parts[0]) or iu.find_spec(parts[0]) \n " ,
14191419 " path = Path(spec.origin)\n " ,
14201420 " if len(parts)>1: path = path.parent.joinpath(*parts[1:]).with_suffix('.py')\n " ,
14211421 " spec = iu.spec_from_file_location(name, path)\n " ,
You can’t perform that action at this time.
0 commit comments