This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients brett.cannon, eric.snow
Date 2014-04-05.20:54:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1396731282.96.0.572654595046.issue21156@psf.upfronthosting.co.za>
In-reply-to
Content
The inspiration was that I realized there was no technical reason to have it on InspectLoader. Past that there was my thinking of trying to come up with a source_to_module() method on importlib.abc.Loader which would do the right thing with create_module() and init_module_attrs() such that replicating imp.load_module() would be something like::

  loader = importlib.machinery.SourceLoader  # or something
  with open('file.py') as file:
    module = loader.source_to_module(file.read(), location='file.py')
History
Date User Action Args
2014-04-05 20:54:42brett.cannonsetrecipients: + brett.cannon, eric.snow
2014-04-05 20:54:42brett.cannonsetmessageid: <1396731282.96.0.572654595046.issue21156@psf.upfronthosting.co.za>
2014-04-05 20:54:42brett.cannonlinkissue21156 messages
2014-04-05 20:54:42brett.cannoncreate