Brett Cannon added the comment: The error actually makes sense when you think about the fact that the module is being passed in by filename. That means Python has no clue what values to put in for the spec because Python literally exec()'s the file contents and stuffs it into a new module name __main__. There's no fancy attempt to construct a proper module from scratch like if you had used -m which does fill in the spec. And since importlib.reload() relies entirely on the module's spec to handle reloads it simply can't handle the `__spec__ == None` case that this is triggering.
IOW use `python3 -m reloader` and it will probably work. Closing this as "not a bug". ---------- nosy: +brett.cannon resolution: -> not a bug status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29194> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com