- config = read_config_files(args.channels_file)
- for section in config:
- sp, pin = read_search_path(config[section])
- if pin is None:
- raise Exception(
- 'Cannot update unpinned channel "%s" (Run "pin" before "update")' %
- section)
- if isinstance(sp, AliasSearchPath):
- assert 'git_repo' not in config[section]
- continue
+ config = {
+ section: read_pinned_config_section(section, conf) for section,
+ conf in read_config_files(
+ args.channels_file).items()}
+ alias, nonalias = partition_dict(
+ lambda k, v: isinstance(v[0], AliasSearchPath), config)
+
+ for section, (sp, pin) in nonalias.items():
+ assert not isinstance(sp, AliasSearchPath) # mypy can't see through
+ assert not isinstance(pin, AliasPin) # partition_dict()