From fd0cfd9f894c7f6750bc9e86700632591d70b0f3 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 4 Oct 2015 22:28:06 +0200 Subject: 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. --- stdnum/eu/vat.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'stdnum/eu/vat.py') 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] -- cgit v1.2.3