在Python 2.6+中,您可以处理以下异常:
try:
# stuff
except Exception as e:
return 'exception %s' % type(e)
Run Code Online (Sandbox Code Playgroud)
2.5中的等价物是多少?
Céd*_*ien 11
像这样 :
try:
# stuff
except Exception, e:
return 'exception %s' % type(e)
Run Code Online (Sandbox Code Playgroud)