pytest-dev / apipkg

MIT License
55 stars 17 forks source link

apipkg.initpkg should preserve __spec__ #13

Closed ronaldoussoren closed 3 years ago

ronaldoussoren commented 5 years ago

Apipkg.initpkg should preserve the __spec__ attribute of the original module. This attribute is used by importlib, and in Python 3.7 importlib.util.find_spec('name') will fail when 'name' is already in sys.modules and doesn't have an attribute named __spec__

See also https://bugs.python.org/issue35791