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:
parent
1d2a308c20
commit
405c2992f8
1 changed files with 2 additions and 1 deletions
|
|
@ -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__)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue