Mercurial > babel > mirror
diff babel/messages/extract.py @ 593:99983baf1067 trunk
resort to hard-coded message extractors/checkers if pkg_resources is installed but no egg-info was found (#230)
author | fschwarz |
---|---|
date | Thu, 09 Aug 2012 11:20:25 +0000 |
parents | 1b801a0cb2cb |
children |
line wrap: on
line diff
--- a/babel/messages/extract.py +++ b/babel/messages/extract.py @@ -255,15 +255,18 @@ try: from pkg_resources import working_set except ImportError: - # pkg_resources is not available, so we resort to looking up the - # builtin extractors directly - builtin = {'ignore': extract_nothing, 'python': extract_python} - func = builtin.get(method) + pass else: for entry_point in working_set.iter_entry_points(GROUP_NAME, method): func = entry_point.load(require=True) break + if func is None: + # if pkg_resources is not available or no usable egg-info was found + # (see #230), we resort to looking up the builtin extractors + # directly + builtin = {'ignore': extract_nothing, 'python': extract_python} + func = builtin.get(method) if func is None: raise ValueError('Unknown extraction method %r' % method)