|
38 | 38 |
|
39 | 39 | # typing ------------------------------------------------------ |
40 | 40 |
|
41 | | -fromgit.typesimportTBD,PathLike,Lit_config_levels,Commit_ish,Tree_ish |
| 41 | +fromgit.typesimportTBD,PathLike,Lit_config_levels,Commit_ish,Tree_ish,assert_never |
42 | 42 | fromtypingimport (Any,BinaryIO,Callable,Dict, |
43 | 43 | Iterator,List,Mapping,Optional,Sequence, |
44 | 44 | TextIO,Tuple,Type,Union, |
@@ -481,10 +481,12 @@ def _get_config_path(self, config_level: Lit_config_levels) -> str: |
481 | 481 | raiseNotADirectoryError |
482 | 482 | else: |
483 | 483 | returnosp.normpath(osp.join(repo_dir,"config")) |
| 484 | +else: |
484 | 485 |
|
485 | | -raiseValueError("Invalid configuration level: %r"%config_level) |
| 486 | +assert_never(config_level,# type:ignore[unreachable] |
| 487 | +ValueError(f"Invalid configuration level:{config_level!r}")) |
486 | 488 |
|
487 | | -defconfig_reader(self,config_level:Optional[Lit_config_levels]=None |
| 489 | +defconfig_reader(self,config_level:Optional[Lit_config_levels]=None, |
488 | 490 | )->GitConfigParser: |
489 | 491 | """ |
490 | 492 | :return: |
|