You can use e.args
:
[53]: try:
x2 = myDict['key2']
except KeyError as e:
print e.args[0]
....:
key2
From the docs:
The except clause may specify a variable after the exception name (or
tuple). The variable is bound to an exception instance with the
arguments stored ininstance.args