code: def _get_module_via_sys_modules(self, fullname):
          
          module = sys.modules.get(fullname)
          LOG.debug('_get_module_via_sys_modules(%r) -> %r', fullname, module)
          if not isinstance(module, types.ModuleType):
              LOG.debug('sys.modules[%r] absent or not a regular module',
                        fullname)
              return
  
          path = self._py_filename(getattr(module, '__file__', ''))
          if not path:
              return
  
          is_pkg = hasattr(module, '__path__')
          try:
              source = inspect.getsource(module)
          except IOError:
              # Work around inspect.getsourcelines() bug for 0-byte __init__.py
              # files.
              if not is_pkg:
                  raise
              source = '\n'
  
          if isinstance(source, mitogen.core.UnicodeType):
              # get_source() returns "string" according to PEP-302, which was
              # reinterpreted for Python 3 to mean a Unicode string.
              source = source.encode('utf-8')
  
          return path, source, is_pkg
docs: Attempt to fetch source code via sys.modules. This is specifically to
          support __main__, but it may catch a few more cases.