Updated from_pyfile so its dynamic module creation uses the imp module instead of type.

Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>
This commit is contained in:
Jeff Weber 2010-10-18 23:51:14 -04:00 committed by Armin Ronacher
parent 1d2a308c20
commit 405c2992f8

View file

@ -11,6 +11,7 @@
from __future__ import with_statement
import imp
import os
import sys
@ -114,7 +115,7 @@ class Config(dict):
root path.
"""
filename = os.path.join(self.root_path, filename)
d = type(sys)('config')
d = imp.new_module('config')
d.__file__ = filename
try:
execfile(filename, d.__dict__)