Ensure migrator does not mangle `cli.CommandsByName`
@@ -236,7 +236,11 @@ def _flag_name_stringly_repl(match):
@_migrator
def _commands_opaque_type(source):
- return re.sub('cli\\.Commands', '[]*cli.Command', source, flags=re.UNICODE)
+ return _subfmt(
+ 'cli\\.Commands(?P<suffix>[^B])',
+ '[]*cli.Command{suffix}',
+ source
+ )
@_migrator
