Ticket #10727: thread_local_import.diff

File thread_local_import.diff, 624 bytes (added by Andi Albrecht, 15 years ago)

Patch to check the presence of the thread module to avoid using the buggy _threading_local.local implementation

  • django/db/backends/__init__.py

     
    11try:
     2    # If the thread module is present threading.local refers to
     3    # thread._local. Otherwise it refers to _threading_local.local which
     4    # has a logic error in some Python versions that causes an exception
     5    # upon backend initialization (http://bugs.python.org/issue1522237).
     6    import thread
    27    # Only exists in Python 2.4+
    38    from threading import local
    49except ImportError:
Back to Top