Skip to content

Commit

Permalink
[py3] Added compatibility import of thread/_thread
Browse files Browse the repository at this point in the history
This commit fixes the auto-reload of the development server.

I should have done that change in ca07fda.
  • Loading branch information
aaugustin committed Aug 18, 2012
1 parent 527f967 commit 4c1286c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion django/db/backends/__init__.py
@@ -1,7 +1,7 @@
from django.db.utils import DatabaseError

try:
import thread
from django.utils.six.moves import _thread as thread
except ImportError:
from django.utils.six.moves import _dummy_thread as thread
from contextlib import contextmanager
Expand Down
2 changes: 1 addition & 1 deletion django/utils/autoreload.py
Expand Up @@ -31,7 +31,7 @@
import os, sys, time, signal

try:
import thread
from django.utils.six.moves import _thread as thread
except ImportError:
from django.utils.six.moves import _dummy_thread as thread

Expand Down
2 changes: 2 additions & 0 deletions django/utils/six.py
Expand Up @@ -365,4 +365,6 @@ def iterlists(d):
"""Return an iterator over the values of a MultiValueDict."""
return getattr(d, _iterlists)()


add_move(MovedModule("_dummy_thread", "dummy_thread"))
add_move(MovedModule("_thread", "thread"))
4 changes: 2 additions & 2 deletions docs/topics/python3.txt
Expand Up @@ -122,8 +122,8 @@ Moved modules
Some modules were renamed in Python 3. The :mod:`django.utils.six.moves
<six.moves>` module provides a compatible location to import them.

In addition to six' defaults, Django's version provides ``dummy_thread`` as
``_dummy_thread``.
In addition to six' defaults, Django's version provides ``thread`` as
``_thread`` and ``dummy_thread`` as ``_dummy_thread``.

PY3
---
Expand Down

0 comments on commit 4c1286c

Please sign in to comment.