diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2015-10-04 22:28:06 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2015-10-05 17:37:30 +0200 |
commit | fd0cfd9f894c7f6750bc9e86700632591d70b0f3 (patch) | |
tree | e97515846570470c3b47d83c7d521d8327b096c6 /stdnum/eu/vat.py | |
parent | 38ed9c0beeed897e14c4bcd46ee15e29d81239ed (diff) |
Move finding VAT module to util
This moves the finding of a VAT module to the util module so that it can
be more easily re-used for non-EU countries.
Diffstat (limited to 'stdnum/eu/vat.py')
-rw-r--r-- | stdnum/eu/vat.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/stdnum/eu/vat.py b/stdnum/eu/vat.py index d867e3b..94525d5 100644 --- a/stdnum/eu/vat.py +++ b/stdnum/eu/vat.py @@ -40,7 +40,7 @@ that country. """ from stdnum.exceptions import * -from stdnum.util import clean +from stdnum.util import clean, get_vat_module country_codes = set([ @@ -69,10 +69,7 @@ def _get_cc_module(cc): if cc not in country_codes: return if cc not in _country_modules: - # do `from stdnum.CC import vat` instead of `import stdnum.CC.vat` - # to handle the case where vat is an alias - _country_modules[cc] = __import__( - 'stdnum.%s' % cc, globals(), locals(), ['vat']).vat + _country_modules[cc] = get_vat_module(cc) return _country_modules[cc] |