diff options
| author | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2012-08-26 15:42:37 +0000 |
|---|---|---|
| committer | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2012-08-26 15:42:37 +0000 |
| commit | 12e909ee1cf8379e49cf23c3a7228bf0957cc9e5 (patch) | |
| tree | a7c1f59fe62c5303d67217aea0e3593523a4b436 /docutils/languages | |
| parent | a11aef4b12938161b663d2efa621bfb27cbc168d (diff) | |
| download | docutils-12e909ee1cf8379e49cf23c3a7228bf0957cc9e5.tar.gz | |
Fix [3559988] and [3560841] __import__ local writer, reader, languages and parsers for Python 2.7 up.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7503 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/languages')
| -rw-r--r-- | docutils/languages/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/docutils/languages/__init__.py b/docutils/languages/__init__.py index 57d3ec205..c3d6c05a6 100644 --- a/docutils/languages/__init__.py +++ b/docutils/languages/__init__.py @@ -30,9 +30,12 @@ def get_language(language_code, reporter=None): if tag in _languages: return _languages[tag] try: - module = __import__(tag, globals(), locals(), level=1) + module = __import__(tag, globals(), locals(), level=0) except ImportError: - continue + try: + module = __import__(tag, globals(), locals(), level=1) + except ImportError: + continue _languages[tag] = module return module if reporter is not None: |
