◐ Shell
clean mode source ↗

gh-133351: Fix Cmd completion for lines beginning with `! ` by godlygeek · Pull Request #133362 · python/cpython

@godlygeek

When a line begins with `!` and there's no `do_shell` method defined,
`parsecmd` returns `None` as the `cmd`, which incorrectly leads to
`None` being concatenated to `complete_` and triggering a `TypeError`.

Instead, recognize `None` as a sentinel that means we should call
`completedefault`, as an empty string already is.