Commit 2c56c1b9 authored by Michal Čihař's avatar Michal Čihař

Simplify import code

parent cc657a61
......@@ -24,8 +24,7 @@ from django.core.exceptions import ImproperlyConfigured
# Initialize checks list
CHECKS = {}
for path in appsettings.CHECK_LIST:
i = path.rfind('.')
module, attr = path[:i], path[i + 1:]
module, attr = path.rsplit('.', 1)
try:
mod = __import__(module, {}, {}, [attr])
except ImportError as e:
......
......@@ -24,8 +24,7 @@ from django.core.exceptions import ImproperlyConfigured
# Initialize checks list
SERVICES = {}
for path in appsettings.MACHINE_TRANSLATION_SERVICES:
i = path.rfind('.')
module, attr = path[:i], path[i + 1:]
module, attr = path.rsplit('.', 1)
try:
mod = __import__(module, {}, {}, [attr])
except ImportError as e:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment