Skip to content

import_no_init error #815

@comhar

Description

@comhar

I'm getting this error when running the fastcore test suite locally.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[75], line 1
----> 1 m = import_no_init('fastcore.basics')
      2 test_eq(m.__name__, 'fastcore.basics')
      3 assert hasattr(m, 'store_attr')
      4 

Cell In[74], line 7, in import_no_init(name)
      3     from importlib.machinery import PathFinder
      4     import importlib.util as iu
      5     parts = name.split('.')
      6     spec = PathFinder.find_spec(parts[0])
----> 7     path = Path(spec.origin)
      8     if len(parts)>1: path = path.parent.joinpath(*parts[1:]).with_suffix('.py')
      9     spec = iu.spec_from_file_location(name, path)
     10     mod = iu.module_from_spec(spec)

AttributeError: 'NoneType' object has no attribute 'origin'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions