Skip to content

Instantly share code, notes, and snippets.

@youhei
Created May 11, 2012 04:47
Show Gist options
  • Save youhei/2657599 to your computer and use it in GitHub Desktop.
Save youhei/2657599 to your computer and use it in GitHub Desktop.
using try-else block in actual case
# South support; see http://south.aeracode.org/docs/tutorial/part4.html#simple-inheritance
try:
from south.modelsinspector import add_introspection_rules
except ImportError:
pass
else:
add_introspection_rules([], [r"^picklefield\.fields\.PickledObjectField"])
try:
import sqlalchemy # noqa
except ImportError:
DatabaseBackend = Task = TaskSet = None
else:
from celery.backends.database import DatabaseBackend
from celery.db.models import Task, TaskSet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment