Oops, my bad. I'm thinking of an entirely unrelated get_loader()
function. Meanwhile, I misread your patch entirely, and thought you had
some dead code for os.path processing that is in fact live. So there is
"another" problem (really the only one) that I spotted on this re-read.
Your patch is calling load_module() even if the module is already in
sys.modules. This will *reload* the module, potentially causing
problems elsewhere in the system. You can test this by adding an
assertion to your test's load_module(), that the module isn't already in
sys.modules. Then call get_data for the same module twice.
Sorry again for the mixup.