def _ImportModuleHookBySuffix(name, package=None):
  """Callback when a module is imported through importlib.import_module."""
  _IncrementNestLevel()

  try:
    # Really import modules.
    module = _real_import_module(name, package)
  finally:
    if name.startswith('.'):
      if package:
        name = _ResolveRelativeImport(name, package)
      else:
        # Should not happen. Relative imports require the package argument.
        name = None
    if name:
      _ProcessImportBySuffix(name, None, None)

  return module
Callback when a module is imported through importlib.import_module.