On Apr 24, 12:23 am, Vinay Sajip <[EMAIL PROTECTED]> wrote:
>
> > I agree that thread locals would probably be ideal, but it looks like
> > threading.local was only introduced in Python 2.4. To stay aligned
> > with Django, it should really be 2.3 compatible.
>
> Fair point - I'd forgotten that threading.local arrived with 2.4.

However Django includes the _threading_local module from Python 2.4,
so that it is available to Django apps running on 2.3.  Import it like
this:

try:
    # Only exists in Python 2.4+
    from threading import local
except ImportError:
    # Import copy of _thread_local.py from Python 2.4
    from django.utils._threading_local import local

Andrew


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to