有没有办法简化以下内容:
>>> pycountry.languages.get(name='english')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/pycountry/db.py", line 114, in get
return self.indices[field][value]
KeyError: 'english'
>>> pycountry.languages.get(name='ENGLISH')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/pycountry/db.py", line 114, in get
return self.indices[field][value]
KeyError: 'ENGLISH'
>>> pycountry.languages.get(name='English')
<pycountry.db.Language object at 0x1096374d0>
在上面,&#39;英语&#39;是唯一没有导致异常的项目。