Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #21420 -- Autoreloader on BSD with Python 3.

Thanks Bouke Haarsma for the report.
  • Loading branch information...
commit dbbd10e75f2f078909d231b2fd5ca1a351726faa 1 parent 6010b53
@aaugustin aaugustin authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/utils/autoreload.py
View
4 django/utils/autoreload.py
@@ -37,6 +37,7 @@
from django.conf import settings
from django.core.signals import request_finished
+from django.utils import six
try:
from django.utils.six.moves import _thread as thread
except ImportError:
@@ -170,7 +171,8 @@ def make_kevent(descriptor):
# New modules may get imported when a request is processed. We add a file
# descriptor to the kqueue to exit the kqueue.control after each request.
- watcher = tempfile.TemporaryFile(bufsize=0)
+ buf_kwargs = {'buffering' if six.PY3 else 'bufsize': 0}
+ watcher = tempfile.TemporaryFile(**buf_kwargs)
kqueue.control([make_kevent(watcher)], 0)
def update_watch(sender=None, **kwargs):
Please sign in to comment.
Something went wrong with that request. Please try again.