From 56131d0fb9a1a99577c3866ac63fa0cb8c779cbd Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 1 Jun 2006 04:57:10 +0000 Subject: [PATCH] Fixed #2052 -- Fixed some threading issues for FreeBSD. Thanks, scott@clued-in.co.uk git-svn-id: http://code.djangoproject.com/svn/django/trunk@3045 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/transaction.py | 5 ++++- django/utils/_threading_local.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/django/db/transaction.py b/django/db/transaction.py index 906995ca02..60a743c42a 100644 --- a/django/db/transaction.py +++ b/django/db/transaction.py @@ -12,7 +12,10 @@ Managed transactions don't do those commits, but will need some kind of manual or implicit commits or rollbacks. """ -import thread +try: + import thread +except ImportError: + import dummy_thread as thread from django.db import connection from django.conf import settings diff --git a/django/utils/_threading_local.py b/django/utils/_threading_local.py index 90717a8d84..bf9a25753a 100644 --- a/django/utils/_threading_local.py +++ b/django/utils/_threading_local.py @@ -234,4 +234,7 @@ class local(_localbase): return __del__ __del__ = __del__() -from threading import currentThread, enumerate, RLock +try: + from threading import currentThread, enumerate, RLock +except ImportError: + from dummy_threading import currentThread, enumerate, RLock