raise KeyError(e_msg)

The two-part raise is deprecated.