cwconfig.py
branchstable
changeset 4120 21517d42f2ed
parent 4118 8a9a00a9405c
child 4181 c79135c217df
child 4212 ab6573088b4a
--- a/cwconfig.py	Mon Dec 14 17:54:45 2009 +0100
+++ b/cwconfig.py	Tue Dec 15 11:30:44 2009 +0100
@@ -865,12 +865,12 @@
                     self.warning('site_erudi.py is deprecated, should be renamed to site_cubicweb.py')
 
     def _load_site_cubicweb(self, sitefile):
-        context = {'__file__': sitefile}
-        execfile(sitefile, context, context)
+        from logilab.common.modutils import load_module_from_file
+        module = load_module_from_file(sitefile)
         self.info('%s loaded', sitefile)
         # cube specific options
-        if context.get('options'):
-            self.register_options(context['options'])
+        if getattr(module, 'options', None):
+            self.register_options(module.options)
             self.load_defaults()
 
     def load_configuration(self):