porimol / countryinfo

A python module for returning data about countries, ISO info and states/provinces within them.
MIT License
143 stars 44 forks source link

Avoided failures in name related API methods #11

Closed kaspersorensen closed 4 years ago

kaspersorensen commented 4 years ago

Please first check PR #10 as it precedes this change.

I wanted to first demonstrate that the API methods right now are unsafe (throws KeyError or AttributeError at random). I did that with the tests. Then I fixed the methods to return empty arrays or None as appropriate.