<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_config(filename=None):
 """Load a configuration from a file or stdin. If `filename` is `None` or "-", then configuration gets read from stdin. Returns: A `ConfigDict`. Raises: ConfigError: If there is an error loading the config. """

    try:
        with _config_stream(filename) as handle:
            filename = handle.name
            return deserialize_config(handle.read())
    except (OSError, toml.TomlDecodeError, UnicodeDecodeError) as exc:
        raise ConfigError(
            'Error loading configuration from {}'.format(filename)) from exc