Refs #16682 -- Replaced signal number with equivalent signal.SIGINT.

This commit is contained in:
Mariusz Felisiak 2016-11-25 13:07:57 +01:00 committed by Tim Graham
parent 9a49fdcd8f
commit d391b3a85b
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import os import os
import signal
import sys import sys
import threading import threading
import time import time
@ -225,8 +226,8 @@ class AtomicTests(TransactionTestCase):
with transaction.atomic(): with transaction.atomic():
Reporter.objects.create(first_name='Tintin') Reporter.objects.create(first_name='Tintin')
# Send SIGINT (simulate Ctrl-C). One call isn't enough. # Send SIGINT (simulate Ctrl-C). One call isn't enough.
os.kill(os.getpid(), 2) os.kill(os.getpid(), signal.SIGINT)
os.kill(os.getpid(), 2) os.kill(os.getpid(), signal.SIGINT)
except KeyboardInterrupt: except KeyboardInterrupt:
pass pass
self.assertEqual(Reporter.objects.all().count(), 0) self.assertEqual(Reporter.objects.all().count(), 0)