Skip to content

Commit 549dd4c

Browse files
jbwebermitsuhiko
authored andcommitted
Updated from_pyfile so its dynamic module creation uses the imp module instead of type.
Signed-off-by: Armin Ronacher <[email protected]>
1 parent 98ee2a1 commit 549dd4c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flask/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from __future__ import with_statement
1313

14+
import imp
1415
import os
1516
import sys
1617

@@ -114,7 +115,7 @@ def from_pyfile(self, filename):
114115
root path.
115116
"""
116117
filename = os.path.join(self.root_path, filename)
117-
d = type(sys)('config')
118+
d = imp.new_module('config')
118119
d.__file__ = filename
119120
try:
120121
execfile(filename, d.__dict__)

0 commit comments

Comments
 (0)