1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Fixed #27647 -- Fixed Windows segmentation fault in runserver autoreload.

This commit is contained in:
Aleksi Häkli 2016-12-28 15:04:09 +02:00 committed by Tim Graham
parent 9e734875fe
commit f6671c5d78
2 changed files with 3 additions and 3 deletions

View File

@ -27,6 +27,7 @@ answer newbie questions, and generally made Django that much better:
Albert Wang <aywang31@gmail.com> Albert Wang <aywang31@gmail.com>
Alcides Fonseca Alcides Fonseca
Aleksandra Sendecka <asendecka@hauru.eu> Aleksandra Sendecka <asendecka@hauru.eu>
Aleksi Häkli <aleksi.hakli@iki.fi>
Alexander Dutton <dev@alexdutton.co.uk> Alexander Dutton <dev@alexdutton.co.uk>
Alexander Myodov <alex@myodov.com> Alexander Myodov <alex@myodov.com>
Alex Couper <http://alexcouper.com/> Alex Couper <http://alexcouper.com/>

View File

@ -30,6 +30,7 @@
import os import os
import signal import signal
import subprocess
import sys import sys
import time import time
import traceback import traceback
@ -283,11 +284,9 @@ def reloader_thread():
def restart_with_reloader(): def restart_with_reloader():
while True: while True:
args = [sys.executable] + ['-W%s' % o for o in sys.warnoptions] + sys.argv args = [sys.executable] + ['-W%s' % o for o in sys.warnoptions] + sys.argv
if sys.platform == "win32":
args = ['"%s"' % arg for arg in args]
new_environ = os.environ.copy() new_environ = os.environ.copy()
new_environ["RUN_MAIN"] = 'true' new_environ["RUN_MAIN"] = 'true'
exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ) exit_code = subprocess.call(args, env=new_environ)
if exit_code != 3: if exit_code != 3:
return exit_code return exit_code