It's not just old code. It used to be run in stdlib, where dependencies weren't possible, so they just wrote it to work with or without an optional dependency pygments. I ran it with and without pygments and both branches get hit. I'll refactor this logic so it runs both branches properly in all cases.
Originally posted by @jaraco in #343 (comment)