[issue26186] LazyLoader rejecting use of SourceFileLoader

Brett Cannon report at bugs.python.org
Thu Jan 28 15:30:36 EST 2016


Brett Cannon added the comment:

I think I'm liking the following approach:

  if __debug__:
    hopefully_None = loader.create_module(spec)
    if hopefully_None is not None:
        warnings.warn("watch out!", ImportWarning)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26186>
_______________________________________


More information about the Python-bugs-list mailing list