This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Use importlib instead of imp.

This is for the same reasons as commit: 96ff40f
  • Loading branch information...
oremj committed Dec 19, 2012
1 parent 09c96ac commit 373a6f56a19c131debfb47f7d610280a586661f7
Showing with 3 additions and 3 deletions.
  1. +3 −3 services/utils.py
View
@@ -4,16 +4,13 @@
import os
# get the right settings module
-import imp
settingmodule = os.environ.get('DJANGO_SETTINGS_MODULE', 'settings_local')
if settingmodule.startswith(('zamboni', # typical git clone destination
'workspace', # Jenkins
'project', # vagrant VM
'freddo')):
settingmodule = settingmodule.split('.', 1)[1]
-res = imp.find_module(settingmodule)
-settings = imp.load_module(settingmodule, *res)
import posixpath
import re
@@ -26,6 +23,9 @@
from django.core.management import setup_environ
import commonware.log
+from django.utils import importlib
+settings = importlib.import_module(settingmodule)
+
# Pyflakes will complain about these, but they are required for setup.
setup_environ(settings)
from lib.log_settings_base import formatters, handlers, loggers

0 comments on commit 373a6f5

Please sign in to comment.