Skip to content

Commit 61f12d6

Browse files
committed
Merge pull request pallets#1450 from Carreau/importlib
importlib deprecated in 3.4
2 parents 73c8335 + 2de525c commit 61f12d6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

flask/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
:license: BSD, see LICENSE for more details.
1010
"""
1111

12-
import imp
1312
import os
13+
import types
1414
import errno
1515

1616
from werkzeug.utils import import_string
@@ -123,7 +123,7 @@ def from_pyfile(self, filename, silent=False):
123123
`silent` parameter.
124124
"""
125125
filename = os.path.join(self.root_path, filename)
126-
d = imp.new_module('config')
126+
d = types.ModuleType('config')
127127
d.__file__ = filename
128128
try:
129129
with open(filename) as config_file:

scripts/flaskext_compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
:copyright: (c) 2015 by Armin Ronacher.
1616
:license: BSD, see LICENSE for more details.
1717
"""
18+
import types
1819
import sys
1920
import os
20-
import imp
2121

2222

2323
class ExtensionImporter(object):
@@ -118,7 +118,7 @@ def is_important_frame(self, important_module, tb):
118118

119119
def activate():
120120
import flask
121-
ext_module = imp.new_module('flask.ext')
121+
ext_module = types.ModuleType('flask.ext')
122122
ext_module.__path__ = []
123123
flask.ext = sys.modules['flask.ext'] = ext_module
124124
importer = ExtensionImporter(['flask_%s', 'flaskext.%s'], 'flask.ext')

0 commit comments

Comments
 (0)