Browse Source

Do not set dotted attributes on flask.ext

pull/325/head
Armin Ronacher 13 years ago
parent
commit
9df2aefd7f
  1. 3
      flask/ext/__init__.py
  2. 5
      flask/testsuite/ext.py

3
flask/ext/__init__.py

@ -58,7 +58,8 @@ class _ExtensionImporter(object):
except ImportError:
continue
module = modules[fullname] = modules[realname]
setattr(modules[__name__], modname, module)
if '.' not in modname:
setattr(modules[__name__], modname, module)
return module
raise ImportError(fullname)

5
flask/testsuite/ext.py

@ -31,6 +31,11 @@ class ExtImportHookTestCase(FlaskTestCase):
import_hooks += 1
self.assert_equal(import_hooks, 1)
def teardown(self):
from flask import ext
for key in ext.__dict__:
self.assert_('.' not in key)
def test_flaskext_new_simple_import_normal(self):
from flask.ext.newext_simple import ext_id
self.assert_equal(ext_id, 'newext_simple')

Loading…
Cancel
Save