Blender 2.8 can no longer import module from Textblock
Solved: there was an API change. Thanks to @alyawn for posting the solution here

This is how it works now:


something = bpy.data.texts['something.py'].as_module()