From baf63f6e5731bea3da74803ac17be890a99b056b Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Fri, 30 Dec 2011 14:12:31 +0000 Subject: [PATCH] Fixed #10725 -- When the child process spawned by the autoreloader gets killed by a signal, passed the signal to the parent, in order to make debugging easier. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17296 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/autoreload.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py index ffc60d4b14..85d9907856 100644 --- a/django/utils/autoreload.py +++ b/django/utils/autoreload.py @@ -115,7 +115,11 @@ def python_reloader(main_func, args, kwargs): pass else: try: - sys.exit(restart_with_reloader()) + exit_code = restart_with_reloader() + if exit_code < 0: + os.kill(os.getpid(), -exit_code) + else: + sys.exit(exit_code) except KeyboardInterrupt: pass