forked from pool/python-FormEncode
be9be315ff
* remove-online-tests.patch - Work with new pycountry: * new-pycountry.patch - Run tests - Fix fdupes call - Update to 1.3.1: * no obvious changelog OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-FormEncode?expand=0&rev=20
39 lines
1.4 KiB
Diff
39 lines
1.4 KiB
Diff
From: Chris Lamb <lamby@debian.org>
|
|
Date: Mon, 6 Aug 2018 22:29:58 +0800
|
|
Subject: Use "alpha_2" over "alpha2" for compatibility with newer versions of
|
|
pycountry.
|
|
|
|
---
|
|
formencode/national.py | 10 +++++-----
|
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/formencode/national.py b/formencode/national.py
|
|
index a8514ab..5a55fab 100644
|
|
--- a/formencode/national.py
|
|
+++ b/formencode/national.py
|
|
@@ -85,19 +85,19 @@ elif pycountry:
|
|
_l = lambda t: gettext.dgettext('iso639', t)
|
|
|
|
def get_countries():
|
|
- c1 = set([(e.alpha2, _c(e.name)) for e in pycountry.countries])
|
|
+ c1 = set([(e.alpha_2, _c(e.name)) for e in pycountry.countries])
|
|
ret = c1.union(country_additions + fuzzy_countrynames)
|
|
return ret
|
|
|
|
def get_country(code):
|
|
- return _c(pycountry.countries.get(alpha2=code).name)
|
|
+ return _c(pycountry.countries.get(alpha_2=code).name)
|
|
|
|
def get_languages():
|
|
- return [(e.alpha2, _l(e.name)) for e in pycountry.languages
|
|
- if e.name and getattr(e, 'alpha2', None)]
|
|
+ return [(e.alpha_2, _l(e.name)) for e in pycountry.languages
|
|
+ if e.name and getattr(e, 'alpha_2', None)]
|
|
|
|
def get_language(code):
|
|
- return _l(pycountry.languages.get(alpha2=code).name)
|
|
+ return _l(pycountry.languages.get(alpha_2=code).name)
|
|
|
|
|
|
############################################################
|